I was recently asked to write some code that would generate multi-part plain text / HTML emails for distribution. I knew there would be some issues between the major providers, Outlook, Outlook 2007, Gmail, Yahoo, Hotmail but I had no clue as I came to find out. The standard method I've used for generating some basic templates was to just mark it up in a html file and use that as a template and replace the key fields as went along and attach a css style element for each individual customer. Thank you Gmail and Outlook 2007 for completely eliminating the <style> tag, making my life a pain.
So my next instinct was to google for a solution because someone has found their way around all this before, right? After a bunch of reading pretty much the only way to format stuff in gmail was to use tables and to apply a very limited subset of formatting options to the <td> tag. Yahoo and Hotmail and Outlook 2003 seem to fully render my emails as expected.
Right now my current plan is to aim for using a rich text editor for the clients to use to apply inline styles to the specific message. I have not yet tested this but this is the behavior that is claimed. If they do not want to use this rich text client they should be able to paste the contents of a Word doc that has been saved as an HTML type into the source of the editor and get the markup in that fashion. In the future I might allow an upload of an HTML doc, stripping the "bad" tags of course and allowing them to use that.
Here is a list of useful links that have helped me immensely while researching this.
xavierfrenette.com has a great article on all the different services and techniques
campaignmonitor.com has some more tips for users based upon the tips from the link above
sitepoint.com has a good article by Tim Slavin
mailchimp.com has some more good tips and even samples to download
reachcustomersonline.com has some good basic tips and lots of links to other tips
The other big one you should know about is that Microsoft Office 2007 has changed their rendering engine from previous versions. They have changed it from using an IE rendering engine to one based upon Word 2007. This eliminates most everything that Gmail does. They have a couple articles to inform you of the new standards and a validation tool you can download and install on Visual Studio 2005, Expression Web Designer or Dreamweaver. The validation tool works well but the only complaint that I have is that it requires you manually edit some registry entries. If they require me to run an msi to use the validator they should at least modify the registry for me since its dirt simple to do.
Word 2007 HTML and CSS Rendering Capabilities in Outlook 2007 (Part 1 of 2)
Word 2007 HTML and CSS Rendering Capabilities in Outlook 2007 (Part 2 of 2)
2007 Office System Tool: Outlook HTML and CSS Validator
I will give an update if I find a better solution.