Guides

Business Email Deliverability: SPF, DKIM and DMARC Explained, With Example Records and a Fix for Website Form Emails

Why business and website form emails land in spam, and how SPF, DKIM and DMARC fix it: example records, SMTP for WordPress forms and a step-by-step fix.

Business Email Deliverability: SPF, DKIM and DMARC Explained, With Example Records and a Fix for Website Form Emails
On this page
  1. Why business emails land in spam
  2. SPF, DKIM and DMARC at a glance
  3. SPF: who may send for your domain
  4. DKIM: a signature on every message
  5. DMARC: the policy and the reports
  6. What Gmail and Yahoo now expect
  7. Website form emails: PHP mail() vs authenticated SMTP
  8. How to test your setup
  9. A step-by-step fix
  10. Quick check
  11. When to get help
  12. FAQs
Key takeaways
  • SPF lists who may send for your domain, DKIM signs each message, and DMARC tells receivers what to do when a message fails, so you need all three.
  • Keep one SPF record per domain, copy exact values from each provider, and start DMARC at p=none, moving to quarantine only when every real sender passes.
  • Send website form emails through an authenticated SMTP login, such as a domain mailbox or a Gmail app password, rather than the server's PHP mail function.

Emails from your domain land in spam, or never arrive, when receiving servers cannot confirm they really came from you. Three DNS records fix most of it: SPF lists the services allowed to send for your domain, DKIM adds a signature that proves a message wasn't forged or altered, and DMARC tells receivers what to do with mail that fails those checks. Website form emails need one more step, because they should be sent through an authenticated SMTP login rather than the web server's basic mail function.

Form checks are part of my WordPress maintenance plans. Email records are also the easiest thing to lose when a site changes host, so they are copied and tested before anything is switched during a WordPress migration.

This guide covers authentication and delivery. If you are still choosing a provider, start with business email options compared, and for a step-by-step mailbox setup on one host, see Hostinger business email setup.

Why business emails land in spam

Every receiving mail server asks whether the sender is who it claims to be. When the answer is unclear, the message is filtered. The usual reasons:

  • No SPF record, or the wrong one, so the server that sent the message isn't on your domain's approved list.
  • No DKIM signature, so receivers can't check the message is genuine and unchanged.
  • No DMARC record, so receivers have no instruction from you and treat unverified mail with suspicion.
  • Website emails sent by the server itself, through PHP's mail function, from a shared hosting server that isn't part of your SPF or DKIM setup.
  • A From address that doesn't match the sender, such as a form that sends "from" the visitor's Gmail address through your web server.
  • A new domain with no history, or a blocklisted server, often after a hacked site sent spam; see website sending spam emails.

A common small business setup in India shows how these combine: the domain at one registrar, the website on shared hosting, email on Google Workspace or Zoho, and a contact form sending through the host's mail function. Each piece works alone, but the domain's DNS doesn't say that all of them may send.

SPF, DKIM and DMARC at a glance

RecordWhat it doesWhere it livesMost common mistake
SPFLists the servers and services allowed to send mail for your domainOne TXT record on the domain itself (the @ or root name)Two SPF records, or a service missing from the list
DKIMPublishes a public key so receivers can verify each message's signatureA TXT or CNAME record at a name like selector._domainkeyRecord added but signing never switched on in the provider's admin panel
DMARCSets your policy for mail that fails, and asks for reportsOne TXT record at _dmarcJumping straight to reject before every sender passes
MXSays where incoming mail for your domain is deliveredMX records on the domainOld MX records left behind after switching provider

MX records handle receiving rather than proof of sender, but belong in the same check. Domain, hosting and SSL explained covers DNS in general.

SPF: who may send for your domain

SPF (Sender Policy Framework) is a single line of text in your DNS. Each include names a service allowed to send as your domain, and the ending says how strictly to treat everything else. The record below is an example of the format only; copy the exact include values from your email provider, newsletter tool and any transactional email service:

Type   Name   Value (example only)
TXT    @      v=spf1 include:_spf.mailbox-provider.example.com include:spf.newsletter-tool.example.com ~all
  • One SPF record per domain. If you add a second TXT record starting with v=spf1, SPF fails for everything. Merge the includes into one record instead.
  • List every real sender: your mailbox provider, your newsletter or CRM tool, and whichever service sends your website's emails.
  • Stay under the lookup limit. The SPF standard allows at most ten DNS lookups when a receiver checks the record, and each include can use several. Remove services you no longer use rather than adding more.
  • The ending: ~all (soft fail) is a common, forgiving choice; -all (fail) is stricter. Once DMARC is in place, its policy matters more than this ending.

SPF alone checks a hidden sender address, not the From address people see, and it often breaks when mail is forwarded. That's why DKIM and DMARC exist.

DKIM: a signature on every message

DKIM (DomainKeys Identified Mail) signs each outgoing message with a private key held by your provider. The matching public key sits in your DNS, under a name that includes a selector, so receivers can look it up and check the signature. If anything in the signed parts of the message changed on the way, the check fails.

Type    Name                    Value (example only)
TXT     mail._domainkey         v=DKIM1; k=rsa; p=MIIBIjANBgkqhkiG9w0B...(long key from your provider)
CNAME   s1._domainkey           s1.domainkey.newsletter-tool.example.com
  • Each sending service has its own selector, so several DKIM records can sit side by side.
  • Some providers give a TXT record with the key; others give a CNAME pointing to a key they manage.
  • With Google Workspace and some others, adding the record is not enough: you also turn on signing in the admin console after the record is live.

DMARC: the policy and the reports

DMARC (Domain-based Message Authentication, Reporting and Conformance) ties the other two to the address people actually see. A message passes DMARC when SPF or DKIM passes and the domain it passed for matches the domain in the From address. This matching is called alignment, and it is why a form that sends "from" your domain through an unlisted server still fails.

Type   Name     Value (example only)
TXT    _dmarc   v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com

Roll the policy out in stages:

  1. p=none asks receivers to report but take no action. Leave it for a few weeks and read the reports to find every service sending as your domain.
  2. p=quarantine asks receivers to send failing mail to spam. Move here only when every legitimate sender passes.
  3. p=reject asks receivers to refuse failing mail outright. It gives the strongest protection against people forging your domain, and it is worth it once you are confident.

Reports arrive as XML attachments that are hard to read by hand. Free and paid DMARC report services turn them into a list of who sends as your domain and whether each source passes. Send them to a separate address, not your main inbox.

Shopify stores have one extra step: authenticating the sender domain inside Shopify. See Shopify emails going to spam for the setup.

What Gmail and Yahoo now expect

At the time of writing, Gmail and Yahoo require everyone sending to their users to authenticate mail, with stricter rules for bulk senders: SPF, DKIM, a DMARC record, aligned From addresses, easy unsubscribing and low complaint rates. Microsoft has announced similar requirements for high-volume senders. Details change, so check each provider's current sender guidelines, but unauthenticated mail is increasingly filtered even at low volumes.

Website form emails: PHP mail() vs authenticated SMTP

By default, WordPress and many form plugins hand email to the web server's PHP mail function. The server sends it without logging in to any mailbox, often from a shared IP address that isn't in your SPF record, with no DKIM signature for your domain, and some hosts limit or block it. Enquiries vanish or sit in spam.

The fix is to send through a real, authenticated account using SMTP, the standard way mail programs log in to send:

OptionSuitsWatch out for
A mailbox on your domain over SMTP, such as website@ your domain on Google Workspace, Zoho Mail, Microsoft 365 or host emailBrochure sites with a handful of form emails a dayMailbox sending limits, and the connection breaking when the password or security settings change
A Gmail account with an app passwordVery small sites where enquiries only go to the owner's own GmailApp passwords need 2-Step Verification, the From address must be that Gmail address, and Google can change what it allows
A transactional email serviceOnline stores, booking and membership sites, busy formsDomain verification with its own SPF and DKIM records before you can send

Either way, set the From address to the account you authenticate with and put the visitor's email in Reply-To, so you can reply directly. On WordPress, one SMTP plugin, such as WP Mail SMTP, FluentSMTP or Post SMTP, handles every email the site sends. Fixing WordPress emails with SMTP walks through the setup, and why contact forms stop getting enquiries covers the problems that aren't about email at all.

How to test your setup

  • Gmail's Show original: send a message to a Gmail account, choose Show original from the three-dot menu, and check that SPF, DKIM and DMARC each say PASS. Repeat with an Outlook.com address, since providers filter differently.
  • DNS lookup tools: online checkers such as MXToolbox show your SPF, DKIM and DMARC records as the world sees them, and flag duplicate SPF records or too many lookups.
  • Spam-score testers: services such as mail-tester.com give you a temporary address to send to, then score the message and list problems.
  • Google Postmaster Tools: shows spam rates and authentication results once you send a meaningful volume to Gmail users.
  • The website itself: submit your real form, or place a test order, and check the headers of the email that arrives.

A step-by-step fix

  1. List every sender: mailbox provider, website, and any newsletter, CRM, invoicing or booking tool that emails as your domain.
  2. Find where your DNS is managed: your registrar, your host or a service such as Cloudflare. Changes made anywhere else do nothing.
  3. Check MX records point only at your current email provider.
  4. Build one SPF record containing an include for each sender, and delete any duplicates.
  5. Turn on DKIM for each service, add its record, then switch signing on in that service's settings.
  6. Add DMARC at p=none, with reports going to a dedicated address.
  7. Move website emails to SMTP, with a matching From address and the visitor in Reply-To.
  8. Test with Show original and a spam-score tester, and fix failures before changing anything else.
  9. Read the DMARC reports for a few weeks, fix any sender you missed, then move to quarantine. Recheck whenever you add a tool or change host.

DNS changes can take a few hours to spread, occasionally longer, so test again the next day before deciding something hasn't worked.

Quick check

Look up your domain's records from any terminal:

nslookup -type=txt yourdomain.com
nslookup -type=txt _dmarc.yourdomain.com

You should see exactly one record starting v=spf1 and one starting v=DMARC1. Then send an email from your domain to a Gmail address, open it, choose Show original, and check that SPF, DKIM and DMARC all say PASS.

When to get help

If any of the three fail, you have two SPF records, or website enquiries and order emails still land in spam, get the DNS and SMTP setup traced. Fixing email delivery and checking forms every month is part of WordPress maintenance. Send the details through the contact form for a fixed quote.

Once SPF, DKIM and DMARC are in place, make WordPress send through your mailbox too: see the tutorial on how to set up SMTP in WordPress with WP Mail SMTP.

Using Zoho? See setting up Zoho Mail on a custom domain for where its SPF and DKIM values go.

FAQs

Do I need SPF, DKIM and DMARC for a small business?

Yes. Even a business sending a few emails a day benefits, because major mailbox providers now expect authenticated mail, and DMARC also makes it harder for scammers to send fake emails using your domain.

Can I have two SPF records?

No. A domain must have only one SPF record. If you add Google Workspace, a newsletter tool and a transactional service, merge all their include values into one record that starts with v=spf1.

What DMARC policy should I start with?

Start with p=none and a reporting address, read the reports for a few weeks, then move to p=quarantine once every legitimate sender passes. Move to p=reject when you are confident nothing genuine is failing.

Why do my website form emails go to spam when my normal email is fine?

Usually because the form sends through the web server's PHP mail function instead of your email provider. Send it through an authenticated SMTP account, with the From address matching that account.

Can I send WordPress form emails through Gmail?

Yes, with an SMTP plugin and a Gmail app password, which needs 2-Step Verification turned on. The email will come from that Gmail address, which is fine when enquiries only go to you. For mail from your own domain, use a domain mailbox or a transactional service.

Need help with your website?

I'm a freelance WordPress developer building fast, SEO-friendly websites since 2020. Tell me what you need and I'll reply with a plan and a fixed quote, usually within 24 hours.

Found this useful? Share it:
Contact

Let's build your next website

Available for freelance projects, agency white-label work and long-term maintenance. Feel free to pass this along to your team or company.

I reply within 24 hours, usually the same day. Your details are emailed to me, then WhatsApp opens so we can chat right away.

Chat now