Home / Guides / WordPress handbook / Chapter 16

WordPress handbook · Chapter 16 · Infrastructure

WordPress Email Deliverability

Password resets, order confirmations and form notifications are often the most business-critical thing a WordPress site does, and the least monitored. Mailbox providers now demand proper domain authentication, so email sent the default way frequently lands in spam or vanishes. This chapter explains the path an email takes from WordPress to an inbox and how to make each step reliable.

Updated · 5 min read · Level: Intermediate

On this page
  1. How WordPress sends email
  2. Choosing how to send
  3. SPF, DKIM and DMARC step by step
  4. Reading email headers to diagnose delivery
  5. Common WordPress email scenarios
  6. Email deliverability checklist

How WordPress sends email

Everything goes through wp_mail(), which builds the message with the bundled PHPMailer library. By default PHPMailer hands it to PHP's mail() function, which passes it to the server's local mail transfer agent (sendmail, Postfix or Exim). That agent sends it directly from the web server's IP address. Problems with this default:

  • The web server's IP is rarely authorised in your domain's SPF record, and messages are not DKIM-signed for your domain, so DMARC fails.
  • Shared hosting IPs are used by thousands of sites; one spammer damages everyone's reputation.
  • Many hosts throttle or disable mail(), or silently drop messages.
  • There are no logs or bounce handling: wp_mail() returning true only means the local agent accepted the message, not that anyone received it.
  • The default sender is wordpress@yourdomain, which may not exist.

The fix is to route mail through an authenticated sending service: a transactional email provider via its API, or SMTP with an authenticated account on your domain. An SMTP plugin (Chapter 13 lists them, and you need exactly one) configures PHPMailer to do this.

Choosing how to send

MethodAdvantagesLimitations
Transactional email provider via API (HTTPS)Works even when SMTP ports are blocked; logs, bounce handling, reputation management; domain authentication built inAccount and DNS setup; costs above free tiers
Provider via SMTPUniversal; same reputation benefitsPorts may be blocked by the host; credentials stored on the site
Your mailbox provider (Google Workspace, Microsoft 365) via SMTPUses existing accountsSending limits per mailbox; basic-password SMTP increasingly restricted in favour of OAuth or app passwords; a site compromise exposes a real mailbox
Host's mail server / PHP mail()No setupPoor deliverability, no logs, shared reputation

Keep transactional email (orders, resets, notifications) separate from marketing email (newsletters). Use different services or at least different sending streams or subdomains, so complaints about a campaign never block order confirmations.

SPF, DKIM and DMARC step by step

SPF: which servers may send for your domain

SPF is one TXT record on your domain listing the servers and services allowed to send mail with your domain in the envelope sender (Return-Path).

example.com.  TXT  "v=spf1 include:_spf.google.com include:spf.provider.example ~all"
  • Only one SPF record per name; merge services into it. Two records make SPF fail with a permanent error.
  • Evaluating SPF may involve at most 10 DNS lookups (each include, a, mx counts, including nested ones). Remove services you no longer use.
  • ~all (softfail) is common while you build confidence; -all (fail) is stricter. Never use +all.

DKIM: cryptographic signature

The sending service signs each message with a private key; you publish the public key in DNS under a selector, for example s1._domainkey.example.com. Providers give you the exact record (often a CNAME to their key, so they can rotate it). DKIM proves the message was not altered and was sent with your domain's authorisation.

DMARC: policy and alignment

DMARC tells receivers what to do when a message fails authentication, and sends you reports. Crucially, it requires alignment: SPF or DKIM must pass for the same domain as the visible From address. A provider that signs with its own domain passes DKIM but fails DMARC for you; that is why you configure custom DKIM for your domain.

_dmarc.example.com.  TXT  "v=DMARC1; p=none; rua=mailto:[email protected]; fo=1"
# After reports show every legitimate source passing (weeks):
_dmarc.example.com.  TXT  "v=DMARC1; p=quarantine; pct=100; rua=mailto:[email protected]"
# Finally:
_dmarc.example.com.  TXT  "v=DMARC1; p=reject; rua=mailto:[email protected]"

Start at p=none to collect aggregate reports without affecting delivery. Use a DMARC report analyser, because the raw XML is hard to read. Find every service that sends as your domain (website, CRM, helpdesk, invoicing, newsletter), make each one aligned, then tighten the policy.

Bulk-sender requirements

Since 2024, Google and Yahoo require bulk senders (thousands of messages a day to their users) to authenticate with SPF and DKIM, publish DMARC, keep spam complaint rates low and support one-click unsubscribe for marketing mail. Microsoft announced similar requirements for Outlook.com in 2025. Even small senders benefit from meeting them.

Reading email headers to diagnose delivery

Every received message carries an Authentication-Results header from the receiving server (in Gmail: "Show original"; in Outlook: "View message source").

Authentication-Results: mx.google.com;
       dkim=pass [email protected] header.s=s1;
       spf=pass smtp.mailfrom=bounces.example.com;
       dmarc=pass (p=QUARANTINE) header.from=example.com
  • dkim=pass [email protected]: signed for your domain (aligned).
  • spf=pass smtp.mailfrom=bounces.example.com: the Return-Path is a subdomain of yours, so it aligns under relaxed alignment.
  • dmarc=pass: everything needed is in place.

The Error Encyclopedia (Chapter 09) has entries for SMTP authentication failure, connection timeouts, sender rejected, spam placement, SPF/DKIM/DMARC failures and sending limits.

Common WordPress email scenarios

ScenarioWhat goes wrongFix
Contact form sends "From" the visitor's addressDMARC fails because the From domain (gmail.com, for example) is not yoursFrom: a mailbox on your domain; Reply-To: the visitor
Order emails go to spam, newsletter fineTransactional mail sent via mail(), newsletter via providerRoute WordPress mail through an authenticated provider
Emails stopped after moving hostsNew IP not in SPF; host blocks portsAPI-based provider
Some emails arrive, then nothingHourly/daily sending limit reached, often due to form spamStop abuse (Chapter 05); use a provider with suitable limits
Password-reset emails never arriveMail failing silently, or reset requests blocked by a security pluginTest with the SMTP plugin's log; check security logs
Duplicate emailsTwo plugins sending the same notificationRemove one trigger (Chapter 03)
Staging site emailing customersClone with live mail settingsDisable or trap mail on staging (Chapter 15)

Email deliverability checklist

  • WordPress mail routed through one authenticated SMTP/API plugin.
  • From address is a real mailbox on your own domain; forms use Reply-To for visitors.
  • Exactly one SPF record, under 10 lookups, including every sending service.
  • Custom DKIM configured for each sending service.
  • DMARC published with reporting; policy tightened once all sources align.
  • Transactional and marketing email separated.
  • Email logging enabled with a retention period.
  • Test emails checked in Gmail and Outlook: SPF, DKIM, DMARC all pass.
  • Alerts or periodic checks for sending failures.
  • Forms protected against spam so they cannot burn sending limits.

Rather have someone else keep WordPress healthy?

Our managed hosting and care plans cover updates, backups, security monitoring and fixes like the ones in this handbook, so you can get on with running the business.

See Hosting & Care