...

View Full Version : html encoding



ahmedsoliman
12-15-2003, 11:08 AM
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

Mhtml
12-15-2003, 02:29 PM
That couldn't have been your code, it doesn't work properly.

It has to work like this-

message = "text1"
message = "text2"
print message

This will print 'text2' not 'text1text2'

What com are you using to send the email?

ahmedsoliman
12-15-2003, 05:59 PM
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

A1ien51
12-15-2003, 06:15 PM
You need to set the type/encoding to html, I do not remember the syntax off of hand...

Eric

A1ien51
12-15-2003, 06:18 PM
I think it is

Mail.BodyFormat = "0"

not 100%

Eric

Speedy
12-15-2003, 08:27 PM
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

whammy
12-16-2003, 03:21 AM
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. :p

A "message" is exactly what it says.

Anyway... it should probably look like:



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>"

glenngv
12-16-2003, 04:05 AM
' 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/showthread.php?s=&threadid=22817#post115026

whammy
12-16-2003, 04:14 AM
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...

ahmedsoliman
12-16-2003, 05:10 AM
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

Mhtml
12-18-2003, 02:33 PM
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 :p ... All the standard operators would make vb much better to work with, like ++, --, +=, -=, /=, ==, *=,%,|=,<<,>> etc... Alas Microsoft like to be as different as possible.

M@rco
12-20-2003, 12:47 PM
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 :p ... 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"?! :p

"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!


:D



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum