HTML for Emails - pzb/aws-ses GitHub Wiki
When creating HTML for sending via email, you should do a few things. This is not written in stone
- Make sure your page is valid HTML
- Include a DOCTYPE declaration
- Make sure that all the characters in the HTML file are valid for the character set. A HTML validator will flag character errors for you.
- Do not include any Javascript (the email client will not run it). This includes:
- script elements (
<script>
) - handler attributes (
onblah=
) - script URIs (
src="javascript:
) - scripting in styles (
behavior
,-moz-binding
, andexpression
)
- script elements (
- Inline all styles. Some mail clients, notably Google's GMail and Blackberry, do not support style sheets. So use the
style
attribute on elements rather than thestyle
element. - Set height and width on all
img
elements. A number of mail clients do not load external images by default, so set the width and height to make sure the rest of the email is laid out correctly. - Do not use objects in email (that includes Java applets, ActiveX controls, and Adobe Flash SWF). Just avoid the
embed
,object
, andapplet
elements. Also avoid the HTML5video
andaudio
elements. - Use character entity references rather than numeric character references. That is, use
&
not&
or&
. - Don't use references where not necessary.
a
is the same asa
. Just usea
. - Don't use forms. Instead include a link to a page on your website with the form.
- Do not use framesets. Avoid the
frameset
,frame
, andnoframes
elements.
http://www.campaignmonitor.com/resources/category-archive/cat/designing-and-building-emails/ has more information on email client capabilities.