I maintain the web email system where I work. Here are some observations I have noticed, esp. wrt the previous comment:
CSS in head <style>...</style> is ignored.
This is true, especially in GMail. I know it violates XHTML standards, but you'll need to put your CSS styles in the <body>, and if you can make your CSS inline, that is generally more reliable.
Layers <div>...</div> do not display correctly.
I'm not so sure about that. There are quirks, especially in Outlook '07 (uses the MS Word rendering engine (
http://www.campaignmonitor.com/blog/..._design_b.html):
- Background colors are not applied correctly.
- Percentage widths are calculated relative to the document, not the parent element.
- Float doesn't work. At all.
But on the whole, a div displays exactly as you would expect a block-level element to display: with a line break immediately before and after it and 100% width.
In-line CSS not tied to a handful of tags (in table tags for example) do not work correctly or consistently.
This is mainly a problem with Outlook '07 (note: not Outlook '03). Apple's Mail.app, for example, uses Webkit, so everything works the same as it would in Safari.
Javascript is not functional.
This is true of all email clients, presumably as a security precaution.
Form elements are stripped out or modified to display horribly.
This is also true of most email clients. It's generally not a good practice to put a form in an email anyway; it's an email message, not a webpage.
With all that in mind, html created for emails must be far simpler than the techniques used in modern Web pages. If you care about the formatting, send it to yourself before sending it to someone else, and don't send it to your email account used for Apple Mail. Apple Mail has one of the best html rendering engines out there, but since most folks do not use it, you can't rely on how it looks in Mail as any indication of how it will look in Outlook, Yahoo, Google, etc.
This is good advice. You especially want to make sure you test the following clients:
- Microsoft Outlook 2003
- Microsoft Outlook 2007 (uses a completely different rendering engine than '03)
- Apple Mail.app
- AOL (desktop and web apps)
- Microsoft Outlook Web Access
- GMail (quirky about images; use good alt attributes!)
- Yahoo! Mail
For the web-based email clients, be sure to preview your email using different browsers as well.
I've tested emails in about 20 other clients (Eudora, SquirrelMail, others), and they generally render similarly to Outlook '03.