What Makes Coding HTML Email Different from Web Page Coding?

The short answer: software used to view email.

While email software on smart phones tends to be modern, current versions of desktop email software have quirks in how they display HTML email. So do some webmail services. Your HTML email might look fantastic in Outlook but the type might be too small to read on a phone. Or spacing breaks in Gmail or Yahoo! mail.

Here’s a screenshot of an HTML email in Gmail, for example:

An HTML email as code in Gmail

See the blue highlighted bit? That’s an HTML email collapsed into a single line of code. Google Gmail puts all the code above and below your HTML email.

When you code an HTML email, your main problem is to protect your code from any code added around it, as well as email software that automatically strips out code you might include. The other interesting challenge is to write code that adapts your HTML email to the small screen size of a phone while also displaying well in desktop email software.

None of these are problems encountered when you code a web page. Today almost all modern web browsers provide a robust common experience for coders and for people who browse the internet. HTML email is very different, as you can see.

This site collects a wide range of content to help people code their HTML emails. While there is no perfect way to code an HTML email, there are common ways to code that work in most or all cases. Feel free to browse this site and contact me if you have questions or suggestions about resources which have helped you.