J
James
Hello,
I've been testing HTML messages both with CreateMHTMLBody and
HTMLBody, the problem is that the message delivered does not display
css styles correctly. If I use "style" inside html tags within the
"body" the style is applyed. But if I put the styles within the "head"
tags and then reference to them with "class" the styles get completely
ignored.
The complete html code obviusly displays well on browsers.
Here are few lines of code
Set objMail = CreateObject("CDO.Message")
objMail.From = "(e-mail address removed)'
objMail.To = "(e-mail address removed)"
objMail.Subject = "sbj"
txt = txt & "<html>"
txt = txt & "<head>"
txt = txt & "<META http-equiv='Content-Type' content='text/html;
charset=iso-8859-1'>"
txt = txt & "<style type='text/css'>"
txt = txt & "<!--"
txt = txt & ".notapplied {font-family: Arial, Helvetica, sans-serif;
color: #074B89; font-size: 56px; font-weight: bold; }"
txt = txt & "-->"
txt = txt & "</style>"
txt = txt & "</head>"
txt = txt & "<body>"
txt = txt & "<br><h1 style='font-family: Arial, Helvetica, sans-serif;
color: #074B89; font-size: 56px; font-weight: bold;'>applied</h1>"
txt = txt & "<br><h1 class='notapplied'>not applied</h1>"
txt = txt & "</body>"
txt = txt & "</html>"
objMail.HTMLBody = txt
objMail.Send()
set objMail = Nothing
Thanks and happy coding
J
I've been testing HTML messages both with CreateMHTMLBody and
HTMLBody, the problem is that the message delivered does not display
css styles correctly. If I use "style" inside html tags within the
"body" the style is applyed. But if I put the styles within the "head"
tags and then reference to them with "class" the styles get completely
ignored.
The complete html code obviusly displays well on browsers.
Here are few lines of code
Set objMail = CreateObject("CDO.Message")
objMail.From = "(e-mail address removed)'
objMail.To = "(e-mail address removed)"
objMail.Subject = "sbj"
txt = txt & "<html>"
txt = txt & "<head>"
txt = txt & "<META http-equiv='Content-Type' content='text/html;
charset=iso-8859-1'>"
txt = txt & "<style type='text/css'>"
txt = txt & "<!--"
txt = txt & ".notapplied {font-family: Arial, Helvetica, sans-serif;
color: #074B89; font-size: 56px; font-weight: bold; }"
txt = txt & "-->"
txt = txt & "</style>"
txt = txt & "</head>"
txt = txt & "<body>"
txt = txt & "<br><h1 style='font-family: Arial, Helvetica, sans-serif;
color: #074B89; font-size: 56px; font-weight: bold;'>applied</h1>"
txt = txt & "<br><h1 class='notapplied'>not applied</h1>"
txt = txt & "</body>"
txt = txt & "</html>"
objMail.HTMLBody = txt
objMail.Send()
set objMail = Nothing
Thanks and happy coding
J