All articles

Your website’s emails going to spam: SPF, DKIM and DMARC explained simply

By Kevin Forma · · 3 min read

Illustration: an envelope on the left, three ticked seals in the centre and an inbox on the right

A customer fills in your contact form and never receives a confirmation. A booking request lands in the junk folder. Or a message from your site arrives nowhere at all.

In most cases the cause is not the form itself, but the way messages are sent and authenticated. Here is how to understand it and check it.

Why an email ends up in junk

A mailbox provider such as Gmail or Outlook asks itself one question for every message it receives: is the sender really who they claim to be? When it cannot check, it files the message as junk, or rejects it.

The big providers have tightened their authentication requirements in recent years. A message that claims to come from your address, but that nothing links to your domain, is treated with suspicion.

The three protections to know

Three settings, three roles

  • SPF: the list of servers allowed to send messages on behalf of your domain. It is a record added to the DNS zone of your domain name.
  • DKIM: a digital signature added to every message. The recipient checks it with a public key published in your DNS zone, which proves the message has not been altered or forged.
  • DMARC: the rule that says what to do with a message whose SPF or DKIM fails (nothing, junk, reject) and where to send reports.

The three work together. SPF and DKIM prove where the message comes from; DMARC sets what to do when the proof is missing.

The most frequent cause on a website

Many sites send their emails from the hosting server, with your business address as the sender. But that server is not always authorised to send for your domain: the messages then pass neither SPF nor DKIM.

The usual fix is to send these messages through a dedicated sending service (SMTP or a transactional email service), configured for your domain, with the matching SPF and DKIM records.

How to check your setup

  • Send yourself a test message from your form to a Gmail address
  • Open the message, then the “Show original” option: the SPF, DKIM and DMARC lines should say “pass”
  • Use a free email-sending test tool, which scores the setup and lists what to fix
  • Look up your domain’s DNS (TXT) records to check that they exist

Also test your other automatic messages: booking confirmation, acknowledgement of receipt, appointment reminder. Each one may follow a different sending path.

Mistakes to avoid

  • Creating two SPF records for the same domain: there must be only one, grouping every authorised service
  • Adding too many services to the SPF: the standard limits the number of DNS lookups to ten
  • Jumping straight to the strictest DMARC rule without watching the reports: legitimate messages could be rejected
  • Editing the DNS zone without saving what is there: a mistake can cut off a website or a mailbox

A DNS change affects your site and your emails. It is best prepared with someone who knows your setup.

Where to start

  • List every service that sends emails in your name (website, booking, invoicing, newsletter)
  • Check the SPF and DKIM records of each one
  • Add a DMARC rule in monitoring mode, then read the reports
  • Tighten the rule in stages, once everything is compliant

This kind of check is part of website maintenance. It also applies to messages sent by an online booking system or an automation.

If messages from your site are not arriving, the 20-minute free call is a chance to describe the situation and see which check would be useful.

Portrait of Kevin Forma, founder of Kayo Agency
Kevin Forma

Founder of Kayo Agency

I learned the trade on the floor, not in meetings. Before writing a single line of code for a client, I spent years in the field, in restaurants. I work alone, with extra hands when a project calls for it: one person knows your file inside out, from the first call to going live.

Tell me about your project.

Have a specific project or a problem to solve? Book a free 20-minute chat. I look at your situation with you and you stay free to decide what comes next.