search by tags

for the user

adventures into the land of the command line

html email templates

so you want to send html styled emails, but are concerned about compatibility with mail clients. here are some things to remember to do

1. spam tables everywhere. <div>’s aren’t gonna work properly, especially in outlook

2. use inline styling instead of linking to a stylesheet. gmail strips the <style> tag

3. be careful with hyperlinks. especially when the display name of the url links to something else, some clients may automatically detect this as dodgy and mark the email as spam

4. if using images, try to be as minimal as possible, you don’t want to be sending massively sized emails

here’s an example template

<table cellspacing="0px" cellpadding="0px" border="0px" width="100%" height="600px">
<tr>
    <td width="100%" height="250px" bgcolor="#F0FFFF" align="center">
        <img src="http://blah.blah.com/blah.png" width="520px" height="250px">
    </td>
</tr>
<tr>
    <td width="100%" height="250px" bgcolor="#FFFFFF" align="center">
        <table cellspacing="0px" cellpadding="0px" border="0px" width="350px" height="200px">
            <tr>
                <td width="100%" height="100%" bgcolor="#FFFFFF" align="left">
                    <font color="#2F4F4F" face="Geneva, Arial" size="2px">
                        Hi there,
                        <br>
                        <br>
                        This email is to confirm that you have just read about html email templates.
                        <br>
                        <br>
                        - Your mate
                        <br>
                    </font>
                </td>
            </tr>
        </table>
    </td>
</tr>
<tr>
    <td width="100%" height="100px" bgcolor="#2F4F4F" align="center">
        <font color="#FFFFFF" face="Geneva, Arial" size="1px">
            If this wasn't you, please let us know at blah
        </font>
    </td>
</tr>
</table>