léonardrodriguez
Menu

How to Optimize HTML Email Code

An archived guide to HTML email compatibility: why newsletters can look different in Outlook, Gmail, and other email clients.

HTML email compatibility
Checking how an HTML email displays in different email clients.

Update: See the follow-up published on May 19, 2011: How to Create an HTML Email or Newsletter.

Before sending a newsletter or promotional email, do you check how it looks in the main desktop and webmail clients?

Yes? I certainly hope so. No? Here are a few examples of what happens when an email hasn’t been tested and adjusted for different clients:

Here are four areas to focus on when optimizing your emails:

Email and HTML go way back

The best way to build clean, compatible emails is to use as little HTML as possible. A good web designer is not necessarily a good email designer. Email markup is different. It takes you back to the way websites were coded a decade before I wrote this article. Pull out those late-1990s HTML guides and set aside elaborate CSS, div-based layouts, and JavaScript. Start with a good old-fashioned table and explicitly defined fonts.

For extra reassurance, follow W3C standards and use the HTML validator. At the time, I recommended valid, standards-compliant markup as a precaution for services such as Gmail.

Email width matters

Most email clients display messages in a fairly narrow space. Remember: you are not building a 960-pixel-wide web page. Outlook, Gmail, and Hotmail often reserve 200–300 pixels on the left for menus, folders, and widgets. My recommendation here was to stay within 600 pixels. Include relevant images without going overboard, and aim for at least an even balance between images and text.

Too much CSS can spoil an email. Use it sparingly.

Email clients do not all support CSS in the same way.

Campaign Monitor put together this guide to save time when checking email compatibility:

Guide to optimizing HTML email for different email clients

Feel free to contact me about optimizing newsletters or promotional emails for different email clients.

Test, check, fix – and test again

Testing is essential. Once you have coded an email, test it in the clients your subscribers actually use. Check webmail services such as Gmail, Hotmail, and Orange; desktop software such as Outlook, Thunderbird, Eudora, Lotus Notes, and AOL; and mobile clients such as BlackBerry, Palm, and iPhone. These were the email clients available when I wrote this article. Tailor your checks to your audience, set priorities, then optimize and test. For a B2B audience, for example, I paid particular attention to Outlook, Thunderbird, and Lotus Notes.

For an Italian consumer audience, do not overlook local webmail services such as Virgilio, Libero, and Alice. If you do not have software that automates these tests, well… good luck!

See Campaign Monitor’s guide to CSS support in email clients.

HistoryPublication, updates and clarifications
  1. Update
  2. First published

Keep exploring.

All articles ↗

SUGGEST A CORRECTION

Spotted an error?

Tell me which passage needs correcting. Include a source if you can, so I can check it.

We use the information you provide to respond to your message. How your data is used