HTML Emails: How to Design, Code and Test Them

HTML Emails: What They Are and How to Build Them | Mailpro

An HTML email is an email built with HTML and CSS, the same languages used for web pages, so it can contain a layout, colors, images, buttons and links. It is the opposite of a plain-text email, which contains text only. Almost every newsletter and marketing email is an HTML email, but coding one is different from coding a web page: email programs support only part of HTML and CSS, so emails rely on older techniques such as tables and inline styles.

HTML email vs plain-text email

HTML email Plain-text email
Content Layout, images, colors, buttons, fonts Text and raw links only
Click and open tracking Yes Clicks only, with tracked links
Best for Newsletters, promotions, product announcements Personal-style messages, short notifications
Risks Rendering differences between email programs, heavy images Less visual impact

Good practice is to send both in one message: an HTML version plus a plain-text version, called a multipart email. Email programs that cannot display HTML show the text version instead.

Why HTML emails are hard to code

Web browsers follow modern standards closely. Email programs do not: Outlook for Windows uses a Word-based rendering engine, Gmail removes some CSS, and mobile apps each have their own rules. A design that looks perfect in one inbox can break in another. That is why email developers follow a specific set of rules.

HTML email best practices

  1. Use tables for the layout. Flexbox and CSS grid are not reliably supported. Nested tables with fixed widths remain the safest way to build columns.
  2. Keep the width around 600 pixels. This fits most preview panes and scales well on mobile.
  3. Inline your CSS. Some email programs ignore styles in the head of the email, so put the styles directly on each element with the style attribute. See what CSS means for email.
  4. Design for mobile first. Use a single column, a large font and big buttons, and add media queries for smaller screens. See responsive email.
  5. Always add alt text to images. Many readers see the email before images load, so the alt text must carry the message. Never put your key message only in an image.
  6. Use web-safe fonts with fallbacks. Custom fonts do not load everywhere. See our guide to the best fonts for email.
  7. Make buttons with HTML, not images. A coded button stays visible and clickable even when images are blocked.
  8. Plan for dark mode. Check that your logo and text stay readable when the email program inverts colors. See dark mode email.
  9. Avoid JavaScript, forms and embedded video. Email programs block them. Link to a web page instead, or use an animated GIF.
  10. Keep the file light. Gmail clips messages whose HTML is larger than about 102 KB and hides the rest behind a "View entire message" link.

Can HTML emails include animation?

Yes, within limits. Animated GIFs work almost everywhere, except that some versions of Outlook show only the first frame, so make that first frame meaningful. CSS animations and interactive formats such as AMP for Email work only in some email programs, so always design a static version that still makes sense.

How to test an HTML email before sending

  • Send test emails to the main inboxes your audience uses: Gmail, Outlook, Apple Mail, and on mobile.
  • Turn images off and check that the email is still readable.
  • Click every link and button.
  • Check the plain-text version and the preheader text.

For a full list, use our HTML email QA checklist.

How to create HTML emails without coding

You do not need to write the code yourself. With a drag-and-drop editor, you build the email from blocks (text, images, buttons, columns) and the tool generates email-safe HTML for you. In Mailpro, you can:

HTML email FAQ

Are HTML emails more likely to go to spam? Not by themselves. Spam filters look at your sender reputation and authentication first. Problems come from broken code, emails that are one big image, or very little text compared with images.

Should I use HTML or plain text? HTML for newsletters and promotions, plain text for short personal messages. Sending both versions together is the safest choice.

What size should an HTML email be? Around 600 pixels wide, and under about 100 KB of HTML so Gmail does not clip it.

Read more about email marketing, or get ideas from our tips for making a great Easter newsletter.

Mailpro and HTML emails

Email-safe HTML, without writing the code

Build your emails with the drag-and-drop editor or 600+ responsive templates, or bring your own HTML. Mailpro is hosted in Switzerland and GDPR-compliant.

Start free with MailproBrowse the templates

Previous Article

   

Next Article

You might also be interested in:

How many times have we heard the phrase "The first impression is the one that counts"? When we think of Email Marketing, this phrase becomes very important. When it comes to the Subject of the Email, you could say it is...
What is an automatic email? An automated email is an email that is sent without having to manually input information every time you want to send a message . They are created and configured only once and are sent to contacts aut...
The success of a business, to a large extent, is determined by the marketing strategies. While most businesses focus on bringing more sales, only savvy marketers know that the best way to move ahead is to focus on a deeper aspect ...
Emails are an effective way of directly communicating with customers. Unlike advertisements, which are designed to attract a large group of customers, emails have a personal approach.So, the objective of email marketing is to dev...
Best Days of the Week to Send Emails Selecting the right day to send your marketing emails can significantly impact their effectiveness in terms of open rates and click-through rates (CTR). Research and various studies have sho...