Email HTML structure is the most neglected category of deliverability optimisation. While email practitioners debate authentication configurations and warmup strategies, the code quality of the email itself quietly undermines inbox placement for the majority of commercial programmes. Unspam.email's 2025 Email Deliverability Report — based on millions of email tests across major mailbox providers — found that 74% of commercial emails contain HTML structural issues including invalid nesting, missing attributes, or accessibility violations. The same report found that emails failing HTML checks showed measurably lower inbox placement specifically at Gmail and Outlook. This is a fixable problem that most programmes have never addressed.
The 74% Finding: HTML Issues Are the Most Neglected Deliverability Factor
Unspam.email's 2025 analysis of email deliverability across millions of tests revealed a striking pattern: HTML structure compliance was the weakest category across all measured deliverability factors, with 74% of emails containing one or more structural issues. This stands in sharp contrast to authentication compliance — where SPF and DKIM adoption now exceeds 90% among tested senders — and spam rate management, where most programmes have learned the fundamental practices. HTML quality has been left behind.
The reason HTML quality is so systematically neglected: email developers learned HTML in the era of table-based layouts, built templates that worked visually, and never had a systematic feedback loop that connected HTML code quality to deliverability outcomes. Visual rendering tests (via Litmus or Email on Acid) catch layout breaks but do not catch the underlying HTML validation issues that affect how spam filters parse and score the email. A template that looks perfect in every email client preview can still contain invalid nesting, missing alt attributes, or malformed elements that contribute to poor spam filter scoring at Gmail and Outlook.
The 2026 context makes this more urgent: Gmail's Gemini AI and Apple Intelligence now parse email HTML content to generate summaries, assess relevance, and apply inbox categorisation. These AI systems encounter the same HTML parsing challenges as human-designed spam filters — but with an added dimension. An AI that cannot reliably parse an email's HTML structure because of invalid nesting or missing semantic elements cannot generate a high-quality inbox summary, which means the email is less likely to receive high AI inbox visibility even if it passes traditional spam filters.
How Gmail and Outlook Actually Read Email HTML
Understanding how spam filters process email HTML requires understanding that they are not browsers — they do not apply CSS layout engines, render visual output, or execute JavaScript. They parse the raw HTML as a document structure and extract signals from that structure. The signals they evaluate:
Document structure validity: Properly nested HTML tags, closed elements, valid attribute usage. Parsers that encounter deeply malformed HTML apply error-correction heuristics that may misclassify content or fail to extract meaningful signals. An unclosed tag or improperly nested div/table combination creates parser uncertainty that is associated with poor-quality or adversarially crafted email in training data.
Text-to-code ratio: The ratio of readable text content to HTML code. An email with 200 characters of visible text inside 15KB of HTML code has a very low text-to-code ratio — a pattern associated with image-heavy spam that uses minimal text to hide behind images. Spam filters score this pattern negatively. Legitimate HTML emails should have meaningful amounts of text content relative to their code volume.
Link density and structure: The number of links relative to text content, and the domain diversity of link destinations. Spam frequently contains many links to many different domains. Legitimate commercial email typically contains 1-10 links, mostly to the sender's own domain or known tracking infrastructure. High link density with mixed-domain URLs is a spam scoring signal in both SpamAssassin (which many enterprise gateways use) and proprietary filters.
Hidden content detection: Content hidden via CSS (display:none, visibility:hidden, font-size:0, color matching background) is a classic spam technique for including spam-trigger keywords that humans cannot see but that were historically meant to fool keyword-based filters. Modern filters detect and heavily penalise hidden content. Any CSS that renders text invisible to the human reader — for any purpose, including preheader tricks — should be reviewed for compliance with modern filter detection.
Critical HTML Violations That Hurt Inbox Placement
The specific HTML issues that Unspam.email's 2025 report identified as having measurable inbox placement impact:
Missing or empty alt attributes on images (found in 61% of tested emails): Every img element must have an alt attribute. Images without alt attributes fail accessibility standards and also remove a legitimate text signal from the email. When images don't load (behind corporate firewalls, in preview pane), an email without alt text contains no visible content — creating a zero-content email experience that spam filters associate with image-only spam. Fix: add descriptive alt text to all images. For decorative images, use alt="" (empty but present).
<!-- WRONG — missing alt attribute --> <img src="hero-banner.jpg" width="600"> <!-- WRONG — generic or empty alt without meaning --> <img src="hero-banner.jpg" alt="image" width="600"> <!-- CORRECT — descriptive alt that conveys content --> <img src="summer-sale-hero.jpg" alt="Summer Sale: 30% off all outdoor furniture through July 15" width="600"> <!-- CORRECT — decorative image, empty alt is appropriate --> <img src="decorative-divider.png" alt="" width="600" role="presentation">
Invalid nesting (found in 43% of tested emails): Block elements nested inside inline elements (a div inside a span), table cell elements outside table context, or improperly nested table structures. These create parser uncertainty and inconsistent rendering. Most email template builders produce some invalid nesting when mixing drag-and-drop components.
Missing DOCTYPE declaration (found in 38% of tested emails): The HTML DOCTYPE tells parsers what version of HTML to expect. Without it, parsers operate in quirks mode, applying inconsistent parsing rules. Email HTML should always begin with a DOCTYPE declaration.
<!-- Always include at the very top of every email --> <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8"> <meta name="viewport" content="width=device-width, initial-scale=1.0"> <meta http-equiv="X-UA-Compatible" content="IE=edge"> <title>Email Title (not shown but improves parsing)</title> </head>
Excessive comment blocks (found in 29% of tested emails): HTML comments (<!-- -->) used to hide content, contain conditional code, or left over from template development. Very long comment blocks are associated with obfuscation techniques in adversarial email. Clean up all unnecessary comments before deployment.
Base64-encoded images inline (found in 21% of tested emails): Embedding images as base64 data URIs rather than external image references dramatically inflates email file size and is associated with evasion techniques (avoiding image hosting that could be blocklisted). Use externally hosted images on branded CDN/image hosting domains rather than base64 inline encoding.
Image-to-Text Ratio: The Underrated Content Signal
Image-to-text ratio is one of the oldest spam filter content signals and remains relevant in 2026 — now with the additional dimension that AI inbox systems (Gemini, Apple Intelligence) cannot read text embedded in images. The ratio signal has two components:
Visual image-to-text ratio: What percentage of the email's visual area is image versus text. An email that is 95% image and 5% text is the classic image-spam pattern — spammers historically placed all content in a single image to avoid keyword-based filters. Modern spam filters no longer rely primarily on keyword matching, but the image-dominant pattern still scores negatively as a content quality signal.
HTML image-to-text ratio: The ratio of img element bytes to text node bytes in the HTML. This differs from the visual ratio because images may be decorative (contributing little visual content) while still dominating the HTML byte count.
The 2026 targets: visible text should account for at least 30-40% of the email's meaningful content area. Every key message, offer, and call-to-action must exist as readable HTML text — not only as image-embedded text that spam filters and AI systems cannot read. The rule is simple: if the key content of your email disappeared if images were disabled, your email has an image-to-text problem.
# SpamAssassin HTML_IMAGE_ONLY_x rules: # HTML_IMAGE_ONLY_04: email has images but no text whatsoever (+2.0 score) # HTML_IMAGE_ONLY_08: email is 0-8% text, rest images (+1.5 score) # HTML_IMAGE_ONLY_12: email is 8-12% text (+0.8 score) # HTML_IMAGE_ONLY_16: email is 12-16% text (+0.4 score) # HTML_IMAGE_ONLY_20: email is 16-20% text (+0.2 score) # Target: above 40% text = no image-only penalty # The text percentage is calculated from readable text content # not code volume — so a 100-word email with 2 images is fine # but a 10-word email with 10 images is penalised
Table-Based Layout vs Semantic HTML: What Spam Filters Prefer
Email HTML has historically used table-based layouts (nested tables for column layouts, spacer images for whitespace, font elements for styling) rather than modern semantic HTML (flexbox, CSS grid, semantic heading elements). This historical practice exists because Outlook's desktop client has poor CSS support — table-based layouts render consistently where CSS-based layouts do not.
The spam filter and AI parsing question: does table-based layout hurt deliverability compared to semantic HTML? The answer is nuanced. Table-based layout does not inherently harm deliverability — it is the standard email rendering approach and spam filters are calibrated for it. However, table-based layout paired with poor structure (missing or incorrect table/tr/td hierarchy, missing closing tags, colspan/rowspan errors) creates parsing ambiguity that does score negatively. The issue is not tables-vs-semantic but valid-vs-invalid structure regardless of the layout paradigm.
In the Gemini AI and Apple Intelligence context, semantic HTML elements do provide a parsing advantage: heading elements (h1, h2) are weighted differently from paragraph text in content hierarchy extraction, list items (li) are identified as enumerated points, and paragraph elements define text blocks. An email that uses proper heading elements for its section titles, paragraph elements for body copy, and list elements for bullet points is more legible to AI content processing than an email that uses div elements with custom CSS classes for all of these — even if the visual rendering is identical.
The HTML Deliverability Audit: What to Check and How
▶ Email HTML Deliverability Audit Checklist
Fixing the Most Common Email HTML Problems
The high-priority fixes that address the issues found in the majority of the 74% non-compliant emails:
Fix 1 — Add missing alt attributes (biggest impact, quickest fix): This is an automated fix in most email platforms. In HTML source, replace every <img src="..."> with <img src="..." alt="[descriptive text]">. For template-level fixes in Mailchimp, HubSpot, or Klaviyo, add alt text in the template editor's image block settings.
Fix 2 — Add meaningful text content to image-heavy templates: For templates that are primarily image-based, add a text block above the hero image that contains the email's key message in HTML text. This text appears before the image in the HTML, is read first by filters, and ensures the email has meaningful text content even if images are disabled.
Fix 3 — Remove base64 inline images: Replace all data:image/... src attributes with externally hosted image URLs on the brand's CDN or image hosting service (Cloudinary, AWS S3 with CloudFront, or the ESP's image hosting). Export all inline images, upload to the CDN, replace src attributes.
Fix 4 — Clean up HTML comments: Remove all HTML comment blocks that are not serving a specific rendering function. Conditional comments for Outlook (<!--[if mso]>) are legitimate and should be kept. Development comments, template instructions embedded as comments, and debugging notes should all be stripped before deployment.
Fix 5 — Validate table structure: Use the W3C HTML validator or an email-specific validator (Parcel's email builder validation, Litmus' code inspector) to identify missing closing tags, improperly nested table elements, and invalid attribute usage.
HTML Testing and Validation Tools for Email
mail-tester.com: Free tool that scores email HTML and content against SpamAssassin and other filters. Send a test email to the unique address provided, and the report reveals specific HTML issues affecting the spam score. The best free HTML audit starting point for any email programme.
GlockApps: Paid inbox placement testing with spam content analysis. GlockApps reports include specific SpamAssassin rules triggered, content scoring details, and inbox placement results across Gmail, Yahoo, Microsoft, and Apple Mail. The content analysis report is the deepest HTML quality diagnostic available in a commercial tool.
Litmus Code Inspector: Available within Litmus' email testing platform. Validates HTML against email rendering standards and identifies common code issues. Litmus acquired Validity in 2025, making the combined Litmus+Validity platform the broadest pre-send email quality tool available.
Unspam.email Spam Checker: Analyses email HTML and content against a multi-factor checklist including the HTML structure issues documented in their 2025 deliverability report. Provides an actionable scorecard specifically designed around the factors their large-scale analysis identified as having inbox placement impact.
W3C HTML Validator (validator.w3.org): For raw HTML validation. Not email-specific, but identifies genuine HTML standards violations that would affect any parser. Export the email HTML to a file and submit to the W3C validator to identify structural issues.
The 74% HTML non-compliance rate is not a permanent fixture of commercial email — it is a fixable quality gap that most programmes have never addressed because the feedback loop between HTML quality and deliverability outcomes has not been visible in standard campaign analytics. Fixing HTML structure issues, adding missing alt attributes, removing hidden content, and correcting image-to-text ratios are among the highest-ROI deliverability improvements available to programmes that have already completed authentication and list hygiene work. The code that carries the message is as important as the message itself.