Contrary to the current trend of using XHTML and CSS and of avoiding tables, to create a HTML email requires one to take a somewhat retro approach to web development. One has to contend with the horrible things that Hotmail, Yahoo Mail, AOL Mail and GMail will do to your code.
Link to an example of a HTML email
Hotmail doesn’t seem to recognise the css property "text-align: center" so if you are asked to horizontally centre the entire email the way to do it for everyone including Hotmail users is to enclose all the content inside your body_replacer <div> in a table with one cell, set to
<td align="center">.
Hotmail removes the underline for links. This can be defeated by
<span style="text-decoration:underline;">
<a href="http://www.replace_this_link.com"> My Account</a>
</span>
Hotmail has a habit of inserting
<p class="MsoNormal">
<font size="3" face="Times New Roman">
<span style="font-size: 12pt;">
</span>
</font>
</p>
after a table which created an unwanted vertical space. Very annoying, couldn’t find a way to defeat it.
If you have succeeded in getting the look you want in Hotmail, Yahoo Mail and Gmail, then you will be pleased to see the same view within the AOL.com website. However, you are in for a shock when viewing the same email on any of the European AOL sites.
In-line styles are completely ignored. Setting the font-size with "11px" will result in the px part being ripped out and your text being plotted at the HTML absolute font size 11, which is very big! My solution below is to define the font twice; in the old fashioned font tag way, backed up with an inline style definition.
<font size="1" face="Arial" style="font-family:Arial, Helvetica, sans-serif; color: #646464; font-size:11px; line-height:130%;">
Inexplicably popular with some corporates, here is a list of tips to cope with the way Lotus Notes deals with emails.
Microsoft decided to stop supporting background images in Outlook 2007. You can still use background colours.