Two Email Bugs That Still Surprise Me (And Break Everything)
Every time I think I’ve seen it all in HTML email, something breaks — again. And not in some obscure client from 2011. I mean in Gmail. In Outlook. In Apple Mail. Clients that real people use every day. The truth is, email clients are weird. And sometimes even bulletproof code springs a leak.
Here are two bugs that still catch me off guard — and what I do to work around them.
Bug #1: Gmail Strips <style>
in the Body
You write a tidy <style>
block in the body of your HTML. You preview in Gmail. Poof. Gone. Gmail wipes it like it never existed.
Why it happens: Gmail moves everything into a secure rendering environment. And it only supports <style>
tags inside the <head>
— and even then, only in specific cases. If your styles are in the body, Gmail might quietly ignore them entirely.
What to do instead: Inline your styles. Use tools like Premailer, Maizzle, or Litmus to automatically inline your CSS. It’s not elegant, but it works. And in email, “it works” is king.
Bug #2: iOS Mail Adds Mysterious Gaps Around Images
You line everything up perfectly. The layout looks clean. Then you open the email on your iPhone — and there’s a ghostly white space under your images. Just enough to ruin the alignment.
Why it happens: iOS Mail sometimes renders inline images with extra space beneath them. It’s a baseline alignment issue, inherited from how inline images behave in HTML by default.
How to fix it: Add display: block;
and line-height: 0;
to your image styles. If you’re nesting images inside tables (and you should be), set border="0"
, cellspacing="0"
, and cellpadding="0"
on the table and style="display: block;"
on the image tag itself.
Bonus tip: Watch out for Apple Mail adding a class called apple-link
on some links. It overrides styles unexpectedly — and if you don’t spot it, your footer links might suddenly turn blue.
Email Development Isn’t Just Coding. It’s Detective Work.
Writing HTML email is like sending your design through a dozen mailboxes, each with its own rules, quirks, and missing keys. The only way to survive is to test relentlessly and learn from what breaks.
Want to skip the detective work? Contact me here and I’ll build it right the first time — weird bugs and all.