Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > ASP .Net > ASP General > CDOSYS and CSS being ignored

Reply
Thread Tools

CDOSYS and CSS being ignored

 
 
James
Guest
Posts: n/a
 
      08-20-2007
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 Removed)'
objMail.To = "(E-Mail 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
 
Reply With Quote
 
 
 
 
Anthony Jones
Guest
Posts: n/a
 
      08-20-2007
"James" <(E-Mail Removed)> wrote in message
news:(E-Mail Removed)...
> 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 Removed)'
> objMail.To = "(E-Mail 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
>



Ignored by what? Outlook Express? Outlook? Thunderbird? A Web based email
agent like Gmail or hotmail?



--
Anthony Jones - MVP ASP/ASP.NET


 
Reply With Quote
 
 
 
 
James
Guest
Posts: n/a
 
      08-21-2007
On Mon, 20 Aug 2007 21:11:29 +0100, "Anthony Jones" wrote:

>Ignored by what? Outlook Express? Outlook? Thunderbird? A Web based email
>agent like Gmail or hotmail?


Ignored by Gmail web interface, OE displays both solutions correctly.

Anyway I do receive html mails with css in the head, as a matter of
fact the MSDN newsletter has css in the head and looks perfect via
web.

What can it be?

Thanks
J
 
Reply With Quote
 
Anthony Jones
Guest
Posts: n/a
 
      08-21-2007
"James" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> On Mon, 20 Aug 2007 21:11:29 +0100, "Anthony Jones" wrote:
>
> >Ignored by what? Outlook Express? Outlook? Thunderbird? A Web based

email
> >agent like Gmail or hotmail?

>
> Ignored by Gmail web interface, OE displays both solutions correctly.
>
> Anyway I do receive html mails with css in the head, as a matter of
> fact the MSDN newsletter has css in the head and looks perfect via
> web.
>
> What can it be?
>


I don't know anything about GMail you would have to ask some where more
appropriate for GMail questions.


--
Anthony Jones - MVP ASP/ASP.NET


 
Reply With Quote
 
Bob Milutinovic
Guest
Posts: n/a
 
      09-02-2007
"James" <(E-Mail Removed)> wrote in message
news(E-Mail Removed)...
> On Mon, 20 Aug 2007 21:11:29 +0100, "Anthony Jones" wrote:
>
>>Ignored by what? Outlook Express? Outlook? Thunderbird? A Web based email
>>agent like Gmail or hotmail?

>
> Ignored by Gmail web interface, OE displays both solutions correctly.
>
> Anyway I do receive html mails with css in the head, as a matter of
> fact the MSDN newsletter has css in the head and looks perfect via
> web.
>
> What can it be?


Examine the names used for class definitions in the working MSDN newsletter,
then examine yours.

It's quite possible that you've used one or more names which overlap those
used by Google.

--
Bob Milutinovic
Cognicom - "Australia's Web Presence Specialists"
http://www.cognicom.net.au/
telephone (0417) 45-77-66
facsimile (02) 9824-2240


 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
ASP CDOSYS SMTP Email attachments are being corrupted rschaeferhig ASP General 4 03-29-2006 10:53 PM
VBCRLF being ignored when sending mail. Help! David Hearn ASP .Net 1 10-27-2004 08:21 PM
Div being ignored Rigga HTML 7 07-13-2004 11:00 PM
ASP.NET Server.ScriptTimeout being ignored =?Utf-8?B?Q2hyaXM=?= ASP .Net 1 05-14-2004 09:38 PM
distutils question-> Why data_files listed in setup.py being ignored?! How fix? Christian Seberino Python 5 10-09-2003 10:18 PM



Advertisments