Using CSS in email? Or alternative?

Reply

Join Date: Jul 2006
Posts: 1,091
Reputation: MattEvans is a jewel in the rough MattEvans is a jewel in the rough MattEvans is a jewel in the rough 
Solved Threads: 63
Moderator
Featured Poster
MattEvans's Avatar
MattEvans MattEvans is offline Offline
Veteran Poster

Re: Using CSS in email? Or alternative?

 
0
  #11
Apr 26th, 2007
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?

HTML and CSS Syntax (Toggle Plain Text)
  1. <span style="font-family:Arial;">inline?</span>

HTML and CSS Syntax (Toggle Plain Text)
  1. <style type="text/css">
  2. span{font-family:Arial;}
  3. </style>
  4. <span>embedded?</span>

HTML and CSS Syntax (Toggle Plain Text)
  1. <link rel="stylesheet" type="text/css" href="http://yourdomain.dot/email.css"/>
  2. <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..
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 232
Reputation: nathanpacker is an unknown quantity at this point 
Solved Threads: 0
nathanpacker's Avatar
nathanpacker nathanpacker is offline Offline
Posting Whiz in Training

Re: Using CSS in email? Or alternative?

 
0
  #12
Apr 26th, 2007
Well I've definitely decided against using CSS, so I'm not using it at all. Before that, I was using linked CSS. But thanks for the info on the HTML. I"ll look into that.
Reply With Quote Quick reply to this message  
Join Date: Oct 2006
Posts: 262
Reputation: Dukane is an unknown quantity at this point 
Solved Threads: 22
Dukane's Avatar
Dukane Dukane is offline Offline
Posting Whiz in Training

Re: Using CSS in email? Or alternative?

 
1
  #13
Apr 27th, 2007
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
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 232
Reputation: nathanpacker is an unknown quantity at this point 
Solved Threads: 0
nathanpacker's Avatar
nathanpacker nathanpacker is offline Offline
Posting Whiz in Training

Re: Using CSS in email? Or alternative?

 
0
  #14
Apr 27th, 2007
Originally Posted by Dukane View Post
Why not add an option to the form so the user can select HTML or Plain Text?
Good idea. Clean, easy. Just a little check box in the form. Nice. I'll have to give that a try.
Thanks.
Reply With Quote Quick reply to this message  
Join Date: Dec 2004
Posts: 1,655
Reputation: tgreer is an unknown quantity at this point 
Solved Threads: 35
Team Colleague
tgreer tgreer is offline Offline
Made Her Cry

Re: Using CSS in email? Or alternative?

 
0
  #15
Apr 27th, 2007
The norm for HTML email is to use embedded style attributes in each tag.

HTML and CSS Syntax (Toggle Plain Text)
  1. <p style="font-family: Verdana;">...</p>
Reply With Quote Quick reply to this message  
Join Date: Jan 2007
Posts: 3,210
Reputation: MidiMagic has a spectacular aura about MidiMagic has a spectacular aura about 
Solved Threads: 164
MidiMagic's Avatar
MidiMagic MidiMagic is offline Offline
Nearly a Senior Poster

Re: Using CSS in email? Or alternative?

 
0
  #16
Apr 27th, 2007
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.
Daylight-saving time uses more gasoline
Reply With Quote Quick reply to this message  
Join Date: Apr 2005
Posts: 16,205
Reputation: jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all jbennet is a name known to all 
Solved Threads: 538
Moderator
Featured Poster
jbennet's Avatar
jbennet jbennet is online now Online
Moderator

Re: Using CSS in email? Or alternative?

 
0
  #17
Apr 27th, 2007
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.
If i am helpful, please give me reputation points.
Reply With Quote Quick reply to this message  
Join Date: May 2005
Posts: 232
Reputation: nathanpacker is an unknown quantity at this point 
Solved Threads: 0
nathanpacker's Avatar
nathanpacker nathanpacker is offline Offline
Posting Whiz in Training

Re: Using CSS in email? Or alternative?

 
0
  #18
Apr 27th, 2007
Originally Posted by jbennet View Post
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.
No, not hard at all, I may do that actually. However, I really think that this form is going to be filled out so little, and some will not even supply an email address anyway, as it is optional, so I may just leave it as is. If it were going to a wider group of people, I would change it.

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.
Reply With Quote Quick reply to this message  
Join Date: Oct 2005
Posts: 523
Reputation: pty is on a distinguished road 
Solved Threads: 37
pty's Avatar
pty pty is offline Offline
Posting Pro

Re: Using CSS in email? Or alternative?

 
0
  #19
Apr 29th, 2007
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
Note to self... pocket cup
Reply With Quote Quick reply to this message  
Reply

This thread is more than three months old.
Perhaps start a new thread instead?
Message:



Other Threads in the HTML and CSS Forum
Thread Tools Search this Thread



About Us | Contact Us | Advertise | DaniWeb | Acceptable Use Policy | RSS Feed

©2003 - 2009 DaniWeb® LLC