,
inline CSS instead of style sets or
blocks.
This approach is believed to prevent most problems with displaying emails. But let’s take a closer look at some particular coding mistakes which can ruin your email and try to find solutions to them.
No plain text version
Potential problems. Some email clients, such as Outlook and Gmail, can define your email as spam if it doesn’t have a plain text version. Moreover, sometimes email clients have problems with rendering HTML code. Because of this, HTML emails can be displayed incorrectly, while plain text emails always look the same.
Prevention. Add a plain text version into your email. Luckily, most email service providers add it automatically.
A plain text version of an email
You can implement plain text emails into your email marketing strategy. First of all, such emails look more personal and thus can level up your communication with subscribers. Moreover, some people prefer getting straight to the point of the email, and a colorful layout puts them off.
Using JavaScript, ActiveX, Flash, and more of the kind
Potential problems. Most email clients don’t support these languages, frameworks, and plugins, so a part of your email won’t be rendered, and your subscribers will see nothing but a blank space. Moreover, the email may be banned by anti-virus software.
Prevention. Keep the languages you use to code emails to HTML and CSS. If you need to add some video or audio, upload it to a website, and give a link to it.
Get an eyeful of how NiftyImages presents new product features: the company chose a sequence of images though it could be an explanatory video.
An email from NiftyImages
Too many redirects
Potential problems. Redirects, though needed for analytics, can do more harm than good to your email. For example, they make the loading time of a web page significantly longer. Then, there is the possibility that a user’s browser blocks redirects — thus, the URL will be inaccessible.
Prevention. Try to avoid redirects. But if you still have to use them, check out how much time the loading of a destination URL takes — test your email before launching the whole campaign. Consider your subscribers’ experience: whether they are willing to wait for the URL loading or not.
Shortened links
Potential problems. Shortened links put your emails at risk of ending up in the spam folder. The thing is that in shortened links, the destination URL is unclear. In simple words, it could lead anywhere. Naturally, hackers and spammers take advantage of that.
Prevention. Do not use shortened links. If your aim is to make your email look neat, without long URLs, you’d better use the following HTML tag: .... You can insert any URL here, no matter how long it is.
A complete link successfully hidden in a Sephora email
If you are still eager for shortened links, shorten your own URLs instead of using third-party tools. At least scan the blacklists of link shorteners in advance.
Large email body file size
Potential problems. Both email clients and email service providers have email body size limits as they are designed to transfer relatively small volumes of information. If you don’t fit those limits, your email may be clipped — its ending will be hidden.
Take a look at a newsletter from a music label. When opened via Gmail, it’s clipped.
A clipped email in Gmail
To see its full version, the subscriber needs to tap a link.
The full version of a clipped email in Gmail
A large email body file size can also cause problems with deliverability. Moreover, because of the big size, the email may be considered a security threat by the user’s anti-virus software.
Prevention. Check out the email body size limits of your email service provider and of the email clients which your subscribers use. For example, Google claims an email body size limit of 200 KB. But it’s widely recommended to limit your emails to 100 KB in order to meet the requirements of most email clients. Actually, the email from the example above has a size of 136 KB.
Too many fonts and colors
Potential problems. Because of the differences between email clients, not all the fonts and colors can be displayed correctly. Moreover, not all fonts and colors combine well with each other — so you risk creating a weak-sauce email design.
You should also keep in mind that your subscribers’ devices have different screen settings — such as brightness, for instance. And while you’re trying to make your email more vivid, users may suffer from this riot of color.
This is a questionable example of email design: each block has its own colors; this plenty distracts the user from the most important information.
Overly colorful emails can look distracting
Prevention. Choose email-friendly fonts, such as Arial, Comic Sans MS, Courier New, Times New Roman, or Verdana: they are supported by most popular email clients. The size of your text font should be no less than 12-13 px; otherwise, a user will have to zoom in on your email or strain their eyes.
As for colors, you shouldn’t use more than two: one for the general text block, and another to highlight important things, as well as for links and buttons. Make sure that the colors you’ve chosen match the background and look good if a user switches to a dark mode.
Copying email template HTML code from a text editor or website
Potential problems. If you use Microsoft Word or something of the kind to create text for your email and then just copy it, you risk catching some unnecessary formatting, which can spoil your email layout. And if you copy images or some parts of text from a website, JavaScript or Flash elements may be added to your email.
Prevention. To code an email, use text editors that don’t add their own formatting, such as Notepad for Windows or TextEdit for Mac. There are also some online tools that can clean up your formatting, such as TextCleanr. You can also use an HTML Cleaner tool, which allows you to create an email in a user-friendly editor and check the code at the same time.
Using HTML Cleaner
Using three-digit HEX color codes
Potential problems. Though three and six-digit color formats should be equivalent, sometimes email clients render a three-digit format in a slightly different way. For example, with Gmail, you risk getting purple instead of the black you planned: color: #000 turns into color: #500050.
An example of issues with colors in emails
Prevention. As a rule of thumb, stick to the six-digit color format and make sure you use it throughout the whole email.
Attachments
Potential problems. Usually, spammers and hackers attach some files to their emails. If you add an attachment, it may be considered a security threat.
Prevention. Give a link to a file loading page instead of adding the file right to the email.
Here is an example of how you can grant users access to the file you’ve promised. Pay attention to how the link is designated: it should be a clickable piece of comprehensible text so that the user knows what’s going to happen when they tap the link.
An example of a link to a file in an email
Missing alt text
Potential problems. Some users disable downloading images in their browser. If they receive an email, including images without alt text, they will only see blank spaces instead of images and won’t understand the point of the email.
It works the same when someone’s internet connection is too low to download the images quickly enough. Alt text helps solve this problem in a way: when downloading of the images goes wrong, a user can see a text instead.
Prevention. Add an alt attribute to all the images you use. Make sure you do it correctly — by adding it to an img tag: ![text]()
. Limit the alt text to 125 characters, including spaces. Usually it’s enough to add just a couple of words that describe the image precisely. If you have some room left, you can add some context to this description.
Take a look at an excerpt of an email from Sephora.
An excerpt from Sephora’s email
If you check out the code of this email, you can find a CTA as the alt text for the image. Even if users don’t see the image, they will still understand what the brand is offering.
An example of alt text
Image-only layout
Potential problems. If your email only consists of images and doesn’t have any text, you can run into problems with deliverability, displaying, and more. For example, if a user blocks image downloading, they will see literally nothing in your email. Second, plenty of images makes the email body size bigger, and email clients are likely to clip it. Third, a user won’t be able to find your email in a folder via search by word.
Prevention. When creating an email, combine text and images. Don’t forget to add a plain text version of the email and alt text for images; take into account the other advice we’ve given above.
Take a look at this email from Ecwid. It has a responsive design that includes the table layout and media queries, such as max-width: 570px. The email combines different types of content: a colorful, captivating image and text. The six-digit color format is used, for example, color:#979797 or color:#4A4A4A. There are not many images in the email, so its body size is not too big. What’s more, find neither shortened links nor redirects in the email. Overall, this email meets most of the recommendations given above.
An example of a well-balanced email from Ecwid
So, we’ve had a glance at the most common HTML email coding mistakes. Apply our advice, and don’t forget to test your emails before sending: use at least three popular email clients to open your email; if possible, check it via different devices as well. Emulators will also come in handy.
One more way to avoid email coding mistakes
There is one truth: you won't make HTML coding mistakes if you don’t code. Luckily, no-code email designing is waiting for you with SendPulse.
With our intuitive drag and drop editor, we’ve already prevented you from making email coding mistakes. Just add images, text, or video to your email set the fonts and colors to match your brand style, and add links to your social media pages.
To make the whole thing even simpler, you can choose from our free email templates. All the emails created with SendPulse are responsive, so they will look good no matter which device a user chooses to open them.
Checklist for avoiding common HTML email coding mistakes
Below you’ll find the main rules on how to avoid common HTML email coding mistakes. Following these rules, you can avoid problems with deliverability and displaying your emails.
- Add a plain text version to your emails.
- Do not use JavaScript, ActiveX, Flash, or more of the kind. If you need to add some video or audio, upload it to a website, and give a link to it.
- Try to avoid redirects not to increase the loading time of a web page.
- Do not use shortened links — transform a piece of text or an image into a link using HTML.
- Try to limit your email body size to 100 KB — or at least check out the limits of your sending provider and the email clients your subscribers use most.
- Choose email-friendly fonts, such as Arial, Comic Sans MS, Courier New, Times New Roman, or Verdana.
- Try not to combine more than two colors in one email — otherwise, it will look distracting.
- Do not copy text and images for your email from text editors like MS Word or websites: there’s a risk of catching some unnecessary formatting.
- Use a six-digit color format.
- Do not attach files — give a link to a file loading page instead.
- Do not forget to add alt text to images.
- Do not make emails of images only — always add some text.
- Do not forget to test an email before starting a campaign. Use at least three email clients and different devices.
And to not have to think about all of that — start using SendPulse for free!