Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 12 of 12

Thread: html encoding

  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts

    html encoding

    hi all
    i trying now to build form for sending email from vistors to
    webmaster. but i try to make this massge appear as html, colored and bold and etc...
    so my code was:
    massage="<html><body><br>"
    massage="massage from: "
    massage=massage+" "+frommail+" "+"<br>"+" "
    massage=massage+"<b>"+question+"</b>"
    massage=massage+"</body></html>"
    but it reach like this:
    <html><body><br>massage from:sender@yahoo.com ......
    how can i disply it as html

  • #2
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    That couldn't have been your code, it doesn't work properly.

    It has to work like this-
    Code:
    message = "text1"
    message = "text2"
    print message 
    
    This will print 'text2' not 'text1text2'
    What com are you using to send the email?
    Last edited by Mhtml; 12-15-2003 at 01:31 PM.
    Omnis mico antequam dominus Spookster!

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts
    sorry , but i don't copy my code correctly this is thr right code:
    massage="<html><body><br>"
    massage=massage & " massage from: "
    massage=massage & " " & frommail & " " & "<br>" & " "
    massage=massage & "<b>" & question & "</b>"
    massage=massage & "</body></html>"
    .....
    Mail.Body = massage

    yes i try to send email but i need it styled by html tags

  • #4
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    You need to set the type/encoding to html, I do not remember the syntax off of hand...

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #5
    Senior Coder A1ien51's Avatar
    Join Date
    Jun 2002
    Location
    Between DC and Baltimore In a Cave
    Posts
    2,717
    Thanks
    1
    Thanked 94 Times in 88 Posts
    I think it is

    Mail.BodyFormat = "0"

    not 100%

    Eric
    Tech Author [Ajax In Action, JavaScript: Visual Blueprint]

  • #6
    Regular Coder
    Join Date
    May 2003
    Location
    Stockholm, Sweden
    Posts
    107
    Thanks
    0
    Thanked 0 Times in 0 Posts
    ahmedsoliman,

    did you solve this? If so it would be
    greatly appreciated if you posted the
    working code so that others don't need
    to ask the same question.

    I asked about this too but no one aswered it
    yet so maybe you could help me out?

    /Speedy

  • #7
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Ok... first of all, a "massage" is when someone rubs your body to relax your muscles, etc. to make you feel good. I'm aware that English is not your native language, so I'll forgive you for that.

    A "message" is exactly what it says.

    Anyway... it should probably look like:

    Code:
    Dim message
    
    message = "<html><body><br />"
    message = message & "This message is from: "
    message = message & frommail & "<br />"
    message = message & "<b>" & question & "</b>"
    message = message & "</body></html>"
    Last edited by whammy; 12-16-2003 at 02:24 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #8
    Supreme Master coder! glenngv's Avatar
    Join Date
    Jun 2002
    Location
    Philippines
    Posts
    11,074
    Thanks
    0
    Thanked 256 Times in 252 Posts
    ' In order to send the email in HTML format we have to set
    ' both MailFormat and BodyFormat equal to zero

    Mail.MailFormat = 0
    Mail.BodyFormat = 0

    http://www.codingforums.com/showthre...817#post115026
    Glenn
    ____________________________________

    My Blog
    Tower of Hanoi Android app (FREE!)
    Tower of Hanoi Leaderboard
    Samegame Facebook App
    vBulletin Plugins
    ____________________________________

  • #9
    Senior Coder
    Join Date
    Jun 2002
    Location
    41° 8' 52" N -95° 53' 31" W
    Posts
    3,660
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Yup... I excluded that (since I think it was already mentioned) and tried to include the relevant parts where other mistakes were made.

    Using + to concatenate is great in most languages but doesn't seem to work exceptionally well in a sub-standard language like VBScript. For that you need to use "&" on string variants...

    ... it's really a shame that you can't use the common "+=" operator in classic ASP. That would save a bit of trouble...
    Last edited by whammy; 12-16-2003 at 03:18 AM.
    Former ASP Forum Moderator - I'm back!

    If you can teach yourself how to learn, you can learn anything. ;)

  • #10
    Regular Coder
    Join Date
    Jun 2002
    Posts
    129
    Thanks
    0
    Thanked 0 Times in 0 Posts
    thanks for all, i found that each hosting support one or more third party component for sending e-mail messages using an external SMTP server in an ASP or VB environment. each one has different property, so i have to know which one my host use.
    my host use persits aspmail and its property is:

    Mail.IsHTML = True

    sorry whammy but sometimes i like to type my code without appreviation

  • #11
    Senior Coder Mhtml's Avatar
    Join Date
    Jun 2002
    Location
    Sydney, Australia
    Posts
    3,531
    Thanks
    0
    Thanked 1 Time in 1 Post
    Originally posted by whammy

    Using + to concatenate is great in most languages but doesn't seem to work exceptionally well in a sub-standard language like VBScript. For that you need to use "&" on string variants...

    ... it's really a shame that you can't use the common "+=" operator in classic ASP. That would save a bit of trouble...
    Yeah that's what I love about C and php, which is sort of why I haven't really looked back at ASP since I whent from the dark side to the light side ... All the standard operators would make vb much better to work with, like ++, --, +=, -=, /=, ==, *=,%,|=,<<,>> etc... Alas Microsoft like to be as different as possible.
    Omnis mico antequam dominus Spookster!

  • #12
    Regular Coder
    Join Date
    Oct 2003
    Location
    London, UK
    Posts
    411
    Thanks
    0
    Thanked 1 Time in 1 Post
    Originally posted by Mhtml
    Yeah that's what I love about C and php, which is sort of why I haven't really looked back at ASP since I whent from the dark side to the light side ... All the standard operators would make vb much better to work with, like ++, --, +=, -=, /=, ==, *=,%,|=,<<,>> etc... Alas Microsoft like to be as different as possible.
    "standard"?! As in "standard in a completely different language"?!

    "Microsoft like to be as different as possible"?! You say that because they created a new scripting language which provides an alternative to JavaScript/JScript on the Microsoft Windows platform?

    What are you smoking?!! (Can I have some?)

    Syntax differences are what make different languages different!!If you're happier coding in JavaScript/C, then just write your ASP in JScript!! All your favourite "standard" syntaxes are there!


    Marcus Tucker / www / blog
    Web Analyst Programmer / Voted SPF "ASP Guru"


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •