Facebook tracking pixel

MailGenius

How to Test Email HTML Code: Rendering, Links and Spam

Send yourself a copy and open it in Gmail. If it looks right, ship it. That's the advice most guides give, and it's the reason so many campaigns break in production. A browser preview renders your code with the most forgiving engine available, while the inbox your customer opens may be running a rendering model that flattens your layout, hides your button behind a blocked image, or reads your two-column grid aloud as a data table.

Testing email HTML code properly is a search for failures, not a confirmation that the design looks nice. You're hunting four separate things at once: whether the layout survives every client your list really uses, whether every link lands on a live page, whether the message trips spam filters before a human sees it, and whether someone using a screen reader can understand and act on it. Any one of those can sink a campaign that looked flawless on your monitor.

Table of Contents

What to Check Before You Hit Send

A pre-send test isn't a vibe check. It's a fixed set of failure conditions you inspect one at a time, and each has a pass signal you can point at before you release the send. Skip a row and you're guessing.

Rendering. Open the test in Gmail, Outlook desktop, Apple Mail and one Android app. You're looking for collapsed columns, buttons that lose their padding, and a hero image that shoves the call to action below the fold in a narrow preview pane.

Broken links. Click every link from the test send and read the final URL in the address bar, never the one you pasted into the editor. Tracking redirects, staging domains and expired promo pages all surface here.

Images off. Most desktop clients block images by default. If the price, the discount and the button label live inside a JPEG, the reader gets a grey rectangle.

Dark mode. Logos with baked-in dark backgrounds vanish against a dark canvas, and text that inherits a dark color inverts to near-invisible. Check that both survive.

Mobile width at 375 px. Look for sideways scroll and buttons that shrink below roughly 44 px, which is where taps start missing.

Spam and authentication. SPF, DKIM and DMARC all need to pass for the sending domain. A free SPF and DKIM checker tells you within seconds which record is missing or misaligned, and pairing that with a spam score review catches the technical failures that no amount of design polish fixes.

Accessibility. Confirm the document language is declared, images carry meaningful alternate text, and body copy clears a contrast ratio of at least 4.5:1 against its background.

Check Failure to look for Pass signal
Rendering in major clients Collapsed columns, broken buttons, CTA pushed below the fold Same structure in Gmail, Outlook and Apple Mail
Broken links 404 pages, wrong tracking IDs, links to a staging domain Every link opens the intended live page
Images off Blank blocks, offer unclear Offer and CTA still understood as text
Dark mode Invisible text, inverted logos Text and logos stay readable
Mobile at 375 px Horizontal scroll, buttons under about 44 px No sideways scroll, taps land first time
Spam and authentication Failed SPF, DKIM or DMARC, high spam score All three records pass and score is clean
Accessibility Missing language tag, low contrast Language declared, text contrast at least 4.5:1

One failed row is enough to hold a send. The order also matters: fix rendering before you run the spam test, because layout problems frequently explain the spam flags you're staring at. An image-only body, a wall of tiny live text crammed into one cell, or a button that renders as a broken link all look like spam to a filter.

Why One Preview Never Covers Every Inbox

Email clients don't share a rendering standard. They implement HTML and CSS unevenly, and the spread is far wider than commonly assumed. A comparative feature-support assessment published by Mailviewr tested 302 HTML and CSS features across major clients and found Apple Mail supported 91%, Thunderbird 86%, Samsung Email 83%, ProtonMail 66%, Yahoo Mail 40%, AOL 38%, Gmail 30% and Outlook just 16%.

Read the bottom of that list twice. The two clients that dominate consumer lists are the two with the weakest support, so the inbox most likely to break your template is also the one most likely to receive it.

Email client Features supported
Apple Mail 91%
Thunderbird 86%
Samsung Email 83%
ProtonMail 66%
Yahoo Mail 40%
AOL 38%
Gmail 30%
Outlook 16%

What that gap looks like in practice is rarely dramatic. It's a two-column product block that stacks cleanly in Apple Mail and overlaps its own text in Outlook desktop, which relies on the Word rendering engine and drops more CSS than any other client in the assessment. A CSS background image on a hero section disappears entirely, leaving white space where your best product shot should be. Modern layout elements like <section> and <article> are frequently unsupported, so a template built on semantic HTML5 scaffolding can arrive as an unstyled column of text.

Practical rule: Choose your test clients from your own audience data, not from reputation. Pull the opens-by-client breakdown from your analytics, then test the three that cover the majority of your list, which for most senders means Gmail, Outlook and Apple Mail.

That's the part most guides skip. A rendering test is only as good as the client list behind it, and a polished report showing twelve clients you don't reach is decoration. The same audience data tells you where to look next, and running an email inbox placement test alongside the render check shows whether the message reached the inbox, since a beautifully rendered email stuck in the spam folder still failed.

When you know where your readers are, the safe default for everything else is table-based layout with inline CSS. It's less elegant than flexbox. It renders in more places, and that trade is worth taking.

How to Run the Rendering and Link Test

A five-step infographic illustrating how to conduct rendering and link tests for email marketing campaigns.

Run the rendering and link test from the same sending path the campaign will use. Testing from your personal Gmail address tells you how Gmail renders one hand-built message. It says nothing about how your ESP's tracking wrapper, image hosting and link rewriting behave on the live send, and those are the parts most likely to break.

  1. Send the test from your real ESP or CRM, with real merge tags, real links and real images. The common slip is testing a cleaned-up version in a preview tool that strips the tracking parameters and dynamic content the live send depends on.
  2. Open it in Gmail, Outlook, Apple Mail and one Android app. Compare each against your reference image at desktop width. Screenshot the differences rather than squinting at them, because layout drift is easy to dismiss in the moment and hard to unsee once it's documented.
  3. Switch every client to dark mode. Confirm logos and body text remain readable. The slip here is checking dark mode only in Apple Mail, which handles it well, and never opening Outlook, where inverted backgrounds are more common.
  4. Turn images off. Ask whether the offer, the price and the call to action still make sense as plain text. Campaigns fail at this step more than any other, because the button is a picture and the picture is blocked.
  5. Resize to 375 px. Look for horizontal scroll and check that buttons stay comfortably tappable. If you have to pinch to zoom, so does your reader.
  6. Click every link and button and record the final destination, not the source value. Testing only the links you remember adding is how a stale URL survives to launch.

Six checks, roughly twenty minutes per send.

A worked example of check four: a retail campaign leads with a 30% off banner image, and the discount code itself lives inside that image. With images blocked, the reader sees the CTA text and nothing else. The offer never arrived. The fix is to move the code into live text directly under the banner, so the offer is understandable whether the image loads or not.

Every link in a test send deserves one click. The percentage of campaigns that ship with a link to a staging domain is not zero, and the reader who finds it is the one you were trying to sell to.

The Recovery Fix for a Link That's Already Live

If the send has gone out and a link is broken, you can still repair it. Open the email's source code, search for lid= in the HTML next to the broken link, and note the number after the equal sign. That number identifies the specific link record in your platform, so you replace the right one instead of guessing at a URL in the campaign editor.

Check what your ESP calls its tracking parameter before you edit anything. Parameter names differ between platforms, and changing the wrong one can break every link in the campaign rather than the single one you meant to fix.

Accessibility Checks Automated Tools Miss

A passing automated scan feels like a clean bill of health. It isn't. The Email Markup Consortium analyzed 409,357 HTML emails in 2024 and found 99.97% contained accessibility issues classified as serious or critical, according to its accessibility report. Automated tools catch missing attributes. They don't catch whether the reading order makes sense.

An infographic titled Accessibility Checks Automated Tools Miss, highlighting six critical accessibility issues in email design.

That distinction matters because a checker will happily pass a message where a screen reader announces your layout table as a spreadsheet, cell by cell, before reaching the actual offer. It will pass an image whose alt text says "banner" instead of describing the product. It will pass a link that reads "click here" six times in a row.

The Manual Pass, in Order

  • Declare the document language. A lang attribute on the <html> tag tells a screen reader which voice to use. Without it, a German campaign can be read aloud in an English accent, phoneme by phoneme.
  • Check the heading order. One clear hierarchy, no skipped levels. Headings are how screen reader users scan an email, and a document that jumps from H1 to H4 gives them no way to understand the structure.
  • Write alt text that carries intent. Informative images get text that explains the purpose, decorative images get an empty alt="" so they're skipped entirely. Setting role="presentation" on decorative images stops some clients from announcing them at all.
  • Replace "click here" with descriptive link text. The link should make sense pulled out of context, because that's exactly how screen reader users tab through links.
  • Hold the contrast line. Normal text needs 4.5:1 against its background, large text needs 3:1. Check text that sits on an image or a gradient, not just flat colors.
  • Mark layout tables. Every table used for visual structure carries role="presentation" so assistive technology skips the scaffolding and gets to the content.

Then do the comparison that automated tools can't run: view the email with images disabled and read it as text. If you can't tell what the offer is and what to do next, the accessible version of your campaign doesn't exist yet, regardless of what the checker reported.

Spam Triggers and the Send Decision

Valid HTML is a deliverability issue before it's a design issue. Google's sender rules require HTML emails to follow HTML standards, and the message as a whole to follow the Internet Message Format standard RFC 5322, as set out in Google's email sender guidelines. That second requirement is the one marketers forget: a campaign can render beautifully in every client and still be malformed as an email, with badly formed headers or broken MIME structure, and land in spam anyway.

A hand-drawn illustration showing an email passing through an HTML and RFC 5322 filter for spam detection.

Run the spam checks in this order, because each one depends on the last.

  1. Authentication first. SPF, DKIM and DMARC must pass and align for the sending domain. If authentication fails, content tweaks won't save the send, so fix the records before you touch a single word.
  2. Then the body. Image-heavy layouts with very little live text are a classic flag, and so is hidden text, whether it's set to display:none or colored to match the background. Anchor text that doesn't match its destination is another one, and a misleading link is the version that also annoys the reader.
  3. Then the subject line. All-caps words and repeated punctuation read as shouting to filters and to people. Rewrite in sentence case and keep the promise honest.

Skip the order and you can spend an afternoon rewriting copy under broken DNS.

Trigger Where it shows Fix
Authentication failure DNS records for the sending domain Publish and align SPF, DKIM and DMARC
Image-only body Large img tags with little live text Keep the offer and copy as live text
Hidden text Text in display:none or same color as background Remove it
Spammy subject line All-caps words, repeated punctuation Rewrite in sentence case
Broken or mismatched links Anchor text that differs from the destination Use matching, working URLs
Missing unsubscribe No visible opt-out or list header Add a visible link and one-click header

The unsubscribe row deserves its own attention. Gmail treats senders issuing more than 5,000 messages per day to Gmail accounts as bulk senders and requires an easy opt-out, with unsubscribe requests honored within 48 hours, per Gmail's bulk sender requirements. A template that buries the opt-out in grey 8 px type frustrates readers and works against the compliance workflow behind the send.

When you want a second read on the sending side, run the draft through the free email spam checker. Copy the address shown on the page, send your draft to it, and click "See Your Score" to get authentication feedback, trigger flags and prioritized fixes in one report. The test runs in a closed environment using a unique inbox, so it never touches your real sending domain or IP reputation, and the draft is used for real-time analysis and then discarded rather than stored. Fix the top flagged item, resend the same draft and compare the score, because it moves after each change.

Send rule: release the campaign only when rendering, links, images-off, dark mode, mobile, accessibility and spam all pass. Change any one row and you retest that row, not just the one you think you broke.

A green spam score confirms the sending side. The render, link and accessibility checks confirm the reader side. You need both, and the row you skipped is the one that reaches your customer first.


A clean preview only tells you the email looks right in one place. A single test send to MailGenius covers the sending side: inbox placement, SPF, DKIM and DMARC alignment, spam trigger words, broken links and HTML issues, with no account required on the free version. Send a draft to the address on the page, read the score, and fix the flagged items before your list ever sees them.

Free Email Spam Test:

Will your Email Land in the Spam Folder?

Send an email to the address below to see your Spam Score:
loading...
MailGenius users test over 1M emails per year! By using our Email Tester, you will agree to our Privacy Policy and Terms of Service. The sending email address will receive emails from MailGenius. All tests are hosted on public links.

Try MailGenius Today

Run a Free Email Deliverability Test - Send an Email to the Address Below, then Click “See Your Score”:

Free Email Spam Test:

Will your Email Land in the Spam Folder?

Send an email to the address below to see your Spam Score:
loading...
MailGenius users test over 1M emails per year! By using our Email Tester, you will agree to our Privacy Policy and Terms of Service. The sending email address will receive emails from MailGenius. All tests are hosted on public links.

Try MailGenius Today