forked from drewblas/aws-ses
-
Notifications
You must be signed in to change notification settings - Fork 2
HTML for Emails
pzb edited this page Apr 17, 2011
·
3 revisions
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.
Feel free to make edits to this wiki, especially if things are unclear or missing. By editing or contributing you agree that your changes and additions are licensed under the Creative Commons Attribution-ShareAlike 3.0 license and you also give explicit permission to Amazon Web Services LLC and/or its affiliates to use the material as they see fit, without attribution or other restriction.