Back to main menu

Struggling with deliverability? Maybe it’s your email header.

Deliverability is one of the most challenging issues to troubleshoot with email marketing. Your header information may be a hidden element creating problems with your email delivery. Finding the right email header analyzer can help you diagnose why email providers think you’re sending spam. Combine it with Mailgun’s extensive logs and you’ll have action steps in no time.

What are email headers?

Email headers are pieces of code inserted at the very beginning of an email message. Your subscribers won’t read anything in them — unless they click “Show original” or are handy with code — but inbox providers like Gmail, Yahoo Mail, and Microsoft Outlook will. Email services like Mailgun can also scan and read email headers. That’s because spammers often use complex techniques to add in malicious code into headers of emails that look perfectly normal (or even ones that look like a friend, colleague, employer, or bank sent them.) Sneaky, right? Headers contain information about:

  • The sender (often called SMTP ID or ESMTP ID)

  • The intended recipient

  • Email routing before it reached the inbox

  • Timestamp and date of send (including timezones, like ET or PDT)

  • Email authentication information, like SPF and DKIM records

  • MIME-version files that hold instructions for email clients on what type of data will be included in the message, like GIFs, HTML files, or JPEG images

  • Meta tags like content-type or content-transfer-encoding, or charset (character set) that determine typeface, text size, and format, and other coding elements of designed emails

Additional header fields include the from, to, date, subject line, and preheader text, which are displayed to the recipient, as well as other headers that aren’t normally displayed by the email client, like X-Report-Abuse and X-Apparently-To. Think of your email header as the barcode you sometimes see on envelopes from the post office. Before they reach an inbox, an MTA, or Mail Transfer Agent, stamps the header with a time and date. It’s that final double-check that you are who you say you are — one of the primary gateways to making sure your email makes it to the inbox.

Analyze your email headers for better email delivery

Google, Yahoo, Microsoft Outlook, and other email providers look at more than your message source content to try to determine if a message is spam. Every email also has a message header that gives important information about the message and the sender. These fields include the From, To, Date, and Subject lines which are displayed to recipient, as well as other headers that aren’t normally displayed by the email client, like X-Report-Abuse and X-Apparently-To. You can think of those extra fields as the barcode you sometimes see on envelopes from the post office; they provide information that helps the mailbox provider handle the message properly.

Three email icons lined up diagonally.

Headers prove you and your email are legitimate

Spam filters look for three elements in your email header:

  • That you are who you say you are. Spammers can spoof the From field, so some of the most important email headers provide authentication details that prove you are who you claim you are. Mailbox providers look for SPF and DKIM headers to confirm the IP address of the sender is allowed to send emails for the domain and that the message wasn’t tampered with.

  • That you’re a responsible email sender. Every email marketing message should include an unsubscribe link and header. Mailgun provides Auto Unsubscribe to handle this for you. If your Message ID is formatted incorrectly, Gmail can think the message is spam. Use Mailgun and let us create a properly formatted Message ID for you.

  • That the message wasn’t tampered with in transit. Spammers can intercept messages or spoof them. Adding the right authentication details and records in your email header gives ISPs and mail servers confidence that there’s no funny business.

Mailgun gives you the details you need to set up those records, plus a button to let you verify them.

A graphic image of a document with a gear wheel on the left page to represent settings.

How to use your header analysis

You can use email header analysis on incoming messages to help you manage your own email list and identify problems like signups from competitors and other bad leads. The inbound routing service from Mailgun gives you all the headers in easy-to-work-with JSON.

Sign up today

Improve your email deliverability

Mailgun can help you make sure your emails go out with good headers and high deliverability. If you’re having problems with email delivery, our support team will help you track down the problem. Get started with a free trial now.

Check out our plans to bundle together features for better deliverability. For businesses that send over 100,000 emails.

Other features

Explore beyond email headers

Email header analyzers aren’t the only ways you can improve your deliverability. Mailgun offers a variety of tools to help you send better email — and make sure your headers don’t trip the spam filter, either.

Window icon


Open email icon

Use Cases

See what you can accomplish with the world's best email delivery platform

It's easy to get started. And it's free.
CTA icon