| | |
Using CSS in email? Or alternative?
Please support our HTML and CSS advertiser: PostgreSQL or MySQL? Compare and contrast the two most popular open source databases
![]() |
Personally; I'd prefer to recieve plain text email.
The biggest problem you're likely to hit with email + CSS is linking... for the same reason pictures from remote locations don't load by default; linked CSS ( i.e. link href="" ) isn't going to load by default. There's a risk of someone operating spam emails that invoke cross site scripting attacks (webmail only) even attempt distributed denial of service attacks ( webmail or email applications ) if remote resources are requested upon opening an email.
The only other problem you might run into would be if email clients used their own stripped down parser/renderers; and if those renderers didn't implement CSS fully. For the reason I've already mentioned; CSS shouldn't be implemented fully in email clients; because there are CSS properties that can invoke downloads from remote locations ( background-image for example ).
Ideally though; an email client shouldn't block all CSS to prevent such occurances; it should block whatever module it is that fulfils remote downloads.
How exactly are you using CSS?
The only other problem you might hit is rendering differences in email applications, if they use OS specific controls; those'll likely be the system's lowest common denominator (i.e. My old MS Outlook will use the same HTML rendering component as MSIE5; regardless of the fact Opera is my default browser ).
These pages might help; they are more related to HTML email in webmail clients. Still; CSS is more likely to be actively stripped out of webmail views as apposed to just being ignored, so perhaps they'll help you somewhat..
http://alistapart.com/articles/cssemail
http://www.campaignmonitor.com/blog/...ing_css_1.html
The biggest problem you're likely to hit with email + CSS is linking... for the same reason pictures from remote locations don't load by default; linked CSS ( i.e. link href="" ) isn't going to load by default. There's a risk of someone operating spam emails that invoke cross site scripting attacks (webmail only) even attempt distributed denial of service attacks ( webmail or email applications ) if remote resources are requested upon opening an email.
The only other problem you might run into would be if email clients used their own stripped down parser/renderers; and if those renderers didn't implement CSS fully. For the reason I've already mentioned; CSS shouldn't be implemented fully in email clients; because there are CSS properties that can invoke downloads from remote locations ( background-image for example ).
Ideally though; an email client shouldn't block all CSS to prevent such occurances; it should block whatever module it is that fulfils remote downloads.
How exactly are you using CSS?
HTML and CSS Syntax (Toggle Plain Text)
<span style="font-family:Arial;">inline?</span>
HTML and CSS Syntax (Toggle Plain Text)
<style type="text/css"> span{font-family:Arial;} </style> <span>embedded?</span>
HTML and CSS Syntax (Toggle Plain Text)
<link rel="stylesheet" type="text/css" href="http://yourdomain.dot/email.css"/> <span>remote?</span>
The only other problem you might hit is rendering differences in email applications, if they use OS specific controls; those'll likely be the system's lowest common denominator (i.e. My old MS Outlook will use the same HTML rendering component as MSIE5; regardless of the fact Opera is my default browser ).
These pages might help; they are more related to HTML email in webmail clients. Still; CSS is more likely to be actively stripped out of webmail views as apposed to just being ignored, so perhaps they'll help you somewhat..
http://alistapart.com/articles/cssemail
http://www.campaignmonitor.com/blog/...ing_css_1.html
Last edited by MattEvans; Apr 26th, 2007 at 12:19 pm.
Plato forgot the nullahedron..
Why not add an option to the form so the user can select HTML or Plain Text?
It is very important to read this: http://www.catb.org/~esr/faqs/smart-questions.html
•
•
Join Date: Dec 2004
Posts: 1,655
Reputation:
Solved Threads: 35
The norm for HTML email is to use embedded style attributes in each tag.
HTML and CSS Syntax (Toggle Plain Text)
<p style="font-family: Verdana;">...</p>
Too often the recipient of your email may not have control over his computer, because he is part of a business or university network that is controlled by systems administrators.
One idea is to send a plain text email, and provide a link in it to a formatted website.
One idea is to send a plain text email, and provide a link in it to a formatted website.
Daylight-saving time uses more gasoline
•
•
•
•
Quite a lot of websites (forums etc...) offer the user the choice of either HTML or PlainText. I suppose it wouldnt be that hard to set up.
However, this discussion has been very educational and useful, as I do have a couple other sites with emails that will go out far more regularly, so plain text may be the way to go there.
I came across this post about CSS in email - it may be of some use.
Make sure you encode it as a multipart-mime though because some email clients don't like HTML
Make sure you encode it as a multipart-mime though because some email clients don't like HTML
Note to self... pocket cup
![]() |
Other Threads in the HTML and CSS Forum
- Previous Thread: My website doesn't work on some computers.
- Next Thread: add a video slideshow
| Thread Tools | Search this Thread |
appointments asp background backgroundcolor beta browser bug calendar cart cgi code codeinjection corporateidentity css design development displayimageinsteadofflash dreamweaver emailmarketing epilepsy explorer firefox flash form format google griefers hackers hitcounter hover html ide ie7 ie8 iframe image images internet internetexplorer intranet iphone javascript jpeg layout macbook maps marketshare microsoft mozilla multimedia navigationbars news offshoreoutsourcingcompany opacity opera optimization pnginie6 positioning problem scroll seo shopping studio swf swf. textcolor timecolor titletags url urlseparatedwords visual visualization web webdevelopment webform website windows7






