Jump to content

Archived

This topic is now archived and is closed to further replies.

mort

Multiple stylesheets in emails

Recommended Posts

Made an eShot so that it sends an email via PHP to a database of emails

Want to make it a multiple stylesheets email, as will be going out to people using outlook, firefox, and entourage (macs). Thing is, like browsers, all email clients read the HTML and CSS differently.

Currently I do that with PHP and HTTP_USER_AGENT to decide what the browser is, but obviously cant get PHP to run in email clients as its server side. So any idea how to detect the email browser and specify the stylesheet without PHP

cheers

Share this post


Link to post
Share on other sites
You can't - they could open up the email in what ever agent they want you are simply sending mail to an inbox. The only thing you coudl do is ask the user which client they use and store that in the database and use that value to switch style sheest.

You shoudl read up on css support in email agents - its not very good.

Also web based e-mail like yahoo and hotmail do all kinds of funny things to html emails - like sticking an x on the front of any id attribute value.

Best possible result is in-line css and an absolute minimum
I have actually resorted to table layouts and using html to do the formatting - not good But works on in the non-standards compliant world of html e-mail.

Share this post


Link to post
Share on other sites
hah you were right, it was totally FUBAR'ed when viewed in entourage, as in not one element was in the right place, all the image backgrounds were tiled all over the place
not good lol

thanks for the tip though. Any idea about if margins or padding would work for positioning text inside a table?

Share this post


Link to post
Share on other sites
http://www.google.com/search?hl=en&q=css+support+in+email+clients
very top search result should cover everything.

Share this post


Link to post
Share on other sites

×

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.