How to Set Up SPF, DKIM and DMARC So Your Emails Actually Arrive

Set up SPF, DKIM and DMARC so contact requests, invoices and newsletters reach the inbox: explained in plain English, with examples and common mistakes.

The message from your contact form never shows up, the invoice lands in spam, the newsletter gets rejected. Very often, the cause is missing records in your domain’s DNS. When you set up SPF, DKIM and DMARC, receiving servers can verify whether an email sent from your address really came from you.

In this guide I’ll explain the three methods, show sample records for the domain example.com and walk you through how to roll them out without blocking your own emails.

Why Emails End Up in Spam

The sender address of an email can be set to anything—much like a letter, where anyone can write any return address on the envelope. Scammers use this to send emails in the name of other companies. That’s why receiving servers check whether a message can be proven to come from the domain it claims. Without that proof, the email is more likely to land in spam or be rejected outright.

Since 2024, major mailbox providers like Gmail have been enforcing stricter rules: bulk senders need all three methods—SPF, DKIM and DMARC—and have to let people unsubscribe from newsletters and promotional emails with one click. Everyone else needs at least SPF or DKIM to send to Gmail. So email authentication isn’t just a concern for big senders; it affects your contact form and your invoices too.

Email Authentication: The Three Methods in Plain English

SPF, DKIM and DMARC work together. You add all three to your domain’s DNS—the same place where it’s defined which server your website points to.

SPF: Who Is Allowed to Send for Your Domain?

With SPF (Sender Policy Framework), you publish which servers are allowed to send email for your domain. To do that, you add a TXT record to the domain. For example.com it could look like this: v=spf1 mx include:_spf.provider.example ~all

Here, mx authorizes your domain’s mail servers, and include: pulls in a service provider’s servers—the exact value, a placeholder here, comes from your provider. The ~all at the end means: no other servers are expected, and their emails should be treated as suspicious. The stricter -all asks receivers to reject them.

There are two rules you should know. First, a domain may only have one SPF record; with two, the check is invalid. Second, the check must not trigger more than ten DNS lookups. Every include counts, as does mx and any lookups inside included records. If you add a lot of services, you’ll hit that limit fast.

DKIM: The Digital Signature

DKIM (DomainKeys Identified Mail) adds a digital signature to every outgoing email. The mail server signs with a private key, and you publish the matching public key in DNS. That lets the recipient check whether the email was signed on behalf of your domain and wasn’t altered along the way.

So that several keys can exist side by side, for example for your mailbox and your newsletter service, each one has a name: the selector. With the selector “mail,” the key lives at mail._domainkey.example.com, and the record starts with v=DKIM1; k=rsa; p=, followed by the key itself. Usually your provider generates the key and you just copy the record. Some providers ask you to add a CNAME record instead.

DMARC: Policy, Reports and Alignment

DMARC (Domain-based Message Authentication, Reporting and Conformance) tells receivers how to handle emails that fail the checks, and it makes sure you get reports. The DMARC record is a TXT record at _dmarc.example.com, for example: v=DMARC1; p=none; rua=mailto:dmarc@example.com

The p policy has three levels: none only monitors, quarantine asks receivers to treat suspicious emails as spam, and reject asks them to turn them away. Many mailbox providers regularly send aggregate reports to the address under rua. They show which servers sent email using your domain and whether the checks passed—they don’t contain the content of your emails. The reports are XML files, and checking tools turn them into something readable.

Alignment is the key concept here. SPF doesn’t actually check the sender address you see in your inbox, but a technical return-path address. That’s why DMARC requires SPF or DKIM to pass and to match the domain in the visible “From” address. By default, the same root domain is enough: news.example.com aligns with example.com.

Account for Every Sender—Including Your Website

Before you add anything, list every service that sends email on behalf of your domain. Typical ones are:

  • your mailbox with your email provider or web host
  • your website with its contact form and confirmation emails
  • your newsletter service
  • your online store with order and shipping confirmations
  • your accounting or invoicing software

If your store, accounting and CRM are connected through APIs, several systems often send emails in your name. Each of these services should sign with your domain via DKIM. Many providers use their own return-path address—in that case SPF won’t match your sender domain, and only DKIM provides alignment. Look in the settings for an option to verify or authenticate your domain.

Website Emails From WordPress

By default, WordPress sends emails through the server’s PHP mail function. That web server often isn’t authorized in your SPF record, and it doesn’t sign with DKIM for your domain either. Contact requests then end up in spam or never arrive at all. A better approach is to send through an SMTP mailbox on your domain: the website logs in there like an email client and sends through it. There are SMTP plugins for this, and some hosts offer the right settings.

Also pay attention to the sender: it should always be an address on your domain, while the visitor’s address belongs in the Reply-To field. On a website for freelancers and self-employed professionals that’s mainly there to bring in inquiries, every lost contact request can mean a missed job. If you’re planning a new WordPress website, put email delivery on your list of questions to ask before the project.

Setting Up SPF, DKIM and DMARC Step by Step

If you set DMARC to strict right away, you risk having your own emails rejected. So follow this order:

  1. List every service that sends email using your domain.
  2. Create an SPF record or extend the existing one—one record for all services.
  3. Enable DKIM for each service and add the keys to your DNS.
  4. Publish DMARC with p=none and an address for reports.
  5. Review the reports for a few weeks: Is a service missing? Are servers you don’t recognize sending mail?
  6. Only once all your own emails pass the checks, switch to p=quarantine and later to p=reject.

With p=reject, receivers that honor DMARC will reject forged emails that use your domain as the sender. My advice: keep an eye on the reports even after that. Every new service has to be added before it sends its first email.

Check Your Settings and Avoid Common Mistakes

How to Check Your Records

Send an email to a mailbox at a major provider and open the full header—in Gmail, via “Show original.” The “Authentication-Results” field shows pass or fail for SPF, DKIM and DMARC. Online checking tools also read your DNS records and flag syntax errors, duplicate SPF records or too many DNS lookups.

Common Mistakes

  • Two SPF records: A new service gets its own record instead of being added to the existing one. That makes SPF invalid for the entire domain.
  • A forgotten service: Your invoicing software is missing from the SPF record and doesn’t sign with DKIM. As soon as the policy gets stricter, those exact emails stop arriving.
  • Jumping straight to p=reject: Without a monitoring phase, gaps only surface once important emails are being rejected.
  • Wrong domain in the sender: The contact form uses the inquirer’s address as the sender, or a service signs with its own domain instead of yours. Then the sender doesn’t match SPF and DKIM, and DMARC fails.

Frequently Asked Questions

Should I set up SPF, DKIM and DMARC even if I only send a few emails?

Yes. The records help every email get recognized as genuine—including your reply to a customer inquiry. On top of that, DMARC makes it harder for scammers to abuse your domain for forged emails.

Where do I add the records?

In your domain’s DNS settings, usually with your web host or the registrar where the domain is registered. Changes don’t take effect everywhere immediately, so wait a while before you check.

What about domains that don’t send any email?

They can be abused too. The SPF record v=spf1 -all declares that no server is allowed to send for the domain. A DMARC policy with p=reject asks receivers to reject forged emails.

The Bottom Line

Setting up SPF, DKIM and DMARC follows a clear path: account for every sender, set up SPF and DKIM for each service, run DMARC in monitoring mode first and then tighten it. That way contact requests, invoices and newsletters are recognized as genuine, and your domain is better protected against abuse.

Want to know whether your domain’s email settings are right, or how your website can send email reliably? I’m happy to talk it through with you—for free, by phone or video call. Book a call here.

Marcel Czeranski

Web designer and developer based in Berlin. I build WordPress websites, apps, and plugins—and run my own digital products: Sponties, Fleißstern, Todoly, and KakapoWP.

More about me