anamika1977
asked on
HTML content type for CDONTS email
Hi all
I'm sending an email with HTML body. When i receive the email the message source shows content_type : "Text/Plain" and then again "Text/html". All the fonts and style sheets don't have any effect. How can i get rid of this problem.
Dim myMail
Set myMail = CreateObject("CDONTS.NewMa il")
HTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & vbCrLf
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<meta http-equiv=""Content-Type" ""
HTML = HTML & "content=""text/html; charset=iso-8859-1"">"
HTML = HTML & "<title>Sample NewMail</title>"
HTML = HTML & "</head>"
HTML = HTML & "<body class='12normal' >"
HTML = HTML & "This is an HTML test e-mail. <BR></body>"
HTML = HTML & "</html>"
myMail.From = "Example@microsoft.com"
myMail.To = "Someone@microsoft.com"
myMail.Subject = "Sample Message"
myMail.BodyFormat = 0
myMail.MailFormat = 0
myMail.Body = HTML
myMail.Send
Set myMail = Nothing
This is how my email body looks like. When i send the email the content-type is "text/plain" and all the formatting is lost.
The message source shows something like this:
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
This is a sample message being sent using HTML.
------=_NextPart_000_0018_ 01C3BE62.F CFE9100
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html><head><meta http-equiv=3D"Content-Type "content=3 D"text/htm l; =
charset=3Diso-8859-1"><tit le>Sample NewMail</title></head><bod y>This is =
a sample message being sent using HTML. <BR></body></html>
How can i get rid of this content type plain text?? Is it a problem with CDONTS setting ?
I'm sending an email with HTML body. When i receive the email the message source shows content_type : "Text/Plain" and then again "Text/html". All the fonts and style sheets don't have any effect. How can i get rid of this problem.
Dim myMail
Set myMail = CreateObject("CDONTS.NewMa
HTML = "<!DOCTYPE HTML PUBLIC ""-//IETF//DTD HTML//EN"">" & vbCrLf
HTML = HTML & "<html>"
HTML = HTML & "<head>"
HTML = HTML & "<meta http-equiv=""Content-Type"
HTML = HTML & "content=""text/html; charset=iso-8859-1"">"
HTML = HTML & "<title>Sample NewMail</title>"
HTML = HTML & "</head>"
HTML = HTML & "<body class='12normal' >"
HTML = HTML & "This is an HTML test e-mail. <BR></body>"
HTML = HTML & "</html>"
myMail.From = "Example@microsoft.com"
myMail.To = "Someone@microsoft.com"
myMail.Subject = "Sample Message"
myMail.BodyFormat = 0
myMail.MailFormat = 0
myMail.Body = HTML
myMail.Send
Set myMail = Nothing
This is how my email body looks like. When i send the email the content-type is "text/plain" and all the formatting is lost.
The message source shows something like this:
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding:
This is a sample message being sent using HTML.
------=_NextPart_000_0018_
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding:
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML//EN">
<html><head><meta http-equiv=3D"Content-Type
charset=3Diso-8859-1"><tit
a sample message being sent using HTML. <BR></body></html>
How can i get rid of this content type plain text?? Is it a problem with CDONTS setting ?
ASKER CERTIFIED SOLUTION
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Have you tried manually formatting the text to see if that works?