Jump to content

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
Link to comment
https://forums.phpfreaks.com/topic/22264-multiple-stylesheets-in-emails/
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.
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?
This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

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.