Emails Going to Spam: SPF, DKIM and DMARC Explained and Set Up
Mail from your domain lands in spam or is rejected. Add correct SPF, DKIM and DMARC records and avoid the common mistakes.
Mailbox providers check three DNS records to decide whether mail from your domain is genuine. Since 2024 Gmail and Yahoo require them from anyone who sends mail in volume, and they help everyone.
SPF: who may send
An SPF record is a DNS TXT record on your domain listing the servers allowed to send. It looks like:
v=spf1 include:_spf.google.com ~all
Use the value your mail provider tells you. Important: a domain may have only one SPF record. If you use two services, merge them into one record, for example v=spf1 include:service-one.com include:service-two.com ~all.
DKIM: a signature on each message
Your mail provider gives you a DKIM record, a long TXT record at a name like selector._domainkey.yourdomain.com. Add it exactly as shown, then turn DKIM signing on in the provider.
DMARC: what to do with failures
DMARC is a TXT record at _dmarc.yourdomain.com. A safe starting record that only monitors is:
v=DMARC1; p=none; rua=mailto:you@yourdomain.com
Later you can move to p=quarantine and then p=reject, once you are sure all your mail passes.
Where to add the records
In the DNS section of the place that controls your nameservers. That is your domain registrar or your host, or a service such as Cloudflare. Records added in the wrong place have no effect.
Test it
Send an email to a free test tool such as mail-tester.com, or look at the original message headers in Gmail and check that SPF, DKIM and DMARC show "pass".
Other causes
- Sending from a free address such as Gmail through your own server.
- A new domain with no sending history. Start with low volume.
- Spammy wording, only images, or broken links in the message.
Related guides
- WooCommerce Password Reset Emails Not Arriving
- WooCommerce Order Emails Not Sending or Going to Spam
- WooCommerce Admin New Order Email or Notification Not Arriving
- Outlook 'Cannot Send Message' on Mobile Hotspot or Public Wi-Fi: Port Blocks