Why does WordPress email fail DMARC?
WordPress email fails DMARC when the site sends from the web host's server with no aligned SPF or DKIM, or when a contact form puts the visitor's address in the From field. The fix is to send through your mail service or a transactional email provider that signs DKIM for your domain, use your own domain in From, and put the visitor in Reply-To.
Key takeaways
- Default WordPress mail is unauthenticated for your domain. Core sends with PHP
mail()through PHPMailer, from the web server, with a From ofwordpress@plus the site's domain. - Forms break DMARC twice. The host's server is not in your SPF and does not sign DKIM as your domain, and many forms copy the visitor's address into From.
- Fix the route first. Send through the organisation's mail service or a transactional provider over SMTP or an API, with DKIM for your domain.
- Then fix the headers. From is always your own domain. The visitor goes in Reply-To.
- Prove it with headers. Look for
dmarc=passandheader.from=your domain inAuthentication-Results.
Why do WordPress emails fail DMARC?
DMARC passes only when SPF or DKIM passes for a domain that aligns with the From address. WordPress mail usually leaves from the web host's server. That server is rarely in your SPF record and does not sign DKIM as your domain. Contact forms add a second problem when they set From to the visitor.
RFC 9989 defines DMARC alignment against the domain in the From header. So three things decide the result: which server sends, which envelope sender it uses, and what From says.
| Cause | What happens | DMARC effect |
|---|---|---|
| Sent from the web host's server IP | Your SPF record does not list it | SPF fails or passes only for another domain |
| Envelope sender belongs to the host | SPF checks the host's domain, not yours | SPF may pass but is not aligned |
| No DKIM for your domain | The server signs with its own domain or not at all | No aligned DKIM |
| From set to the visitor's address | DMARC checks the visitor's domain | Fails against the visitor's policy |
What does WordPress send by default?
WordPress core sends mail with wp_mail(). The wp_mail() reference shows it uses PHPMailer and calls isMail(), so PHP's mail() is the default transport. The default From name is "WordPress" and the default From address is wordpress@ plus the site's host name, with a leading www. removed.
For a site at www.example.com, that gives:
From: WordPress <wordpress@example.com>
The From domain is yours, so DMARC checks your policy. But the message leaves through the local mail program on the web server. Unless the host has set up SPF and DKIM for your domain on that server, nothing aligns. At p=reject, receivers can refuse it.
Why does the envelope sender matter?
SPF checks the envelope sender (the Return-Path), not the From header. With PHP mail(), the envelope sender is set by the host's mail setup. It is often an account on the server's own host name. SPF can then pass for the host's domain while DMARC still fails, because that domain does not match yours.
The PHP manual for mail() explains that the -f option sets the envelope sender. It does not document a default, so check a real message. This "SPF passes, DMARC fails" pattern is covered in why DMARC fails when SPF passes.
Why do contact form notifications fail?
Many form setups put the visitor's email address in From, so the notification looks like it came from the visitor. Your server cannot authenticate the visitor's domain. If that domain publishes a DMARC policy, the message fails it, and receivers may junk or reject the notification.
A typical failing notification looks like this:
From: Jane Visitor <jane@example.org>
To: info@example.com
Subject: New contact form submission
Here DMARC checks example.org, a domain your site has no right to send as. Google's email sender guidelines say plainly: "Don't impersonate Gmail From: headers." A visitor with a Gmail address therefore makes the problem worse.
How do you fix WordPress email DMARC failures?
Fix them in order. First change how mail leaves the site, so it goes through a service that authenticates your domain. Then set From to your own domain and put the visitor in Reply-To. Finally, consider a dedicated subdomain for website mail. Each step builds on the one before.
Step 1: Send through an authenticated service
Route WordPress mail through the organisation's own mail service or a transactional email provider. Connect over SMTP or the provider's API. The service must sign DKIM with your domain (or a subdomain of it), and ideally use an aligned envelope sender too.
You can do this with an SMTP plugin, or in code with the phpmailer_init action. The phpmailer_init reference says it "Fires after PHPMailer is initialized", which is after core has chosen mail(), so a hook can switch to SMTP. A minimal example, with secrets kept in wp-config.php:
// In wp-config.php
define( 'SMTP_HOST', 'smtp.example.net' );
define( 'SMTP_USER', 'website@example.com' );
define( 'SMTP_PASS', 'use-a-secret-store' );
// In a small must-use plugin
add_action( 'phpmailer_init', function ( $phpmailer ) {
$phpmailer->isSMTP();
$phpmailer->Host = SMTP_HOST;
$phpmailer->SMTPAuth = true;
$phpmailer->Port = 587;
$phpmailer->SMTPSecure = 'tls';
$phpmailer->Username = SMTP_USER;
$phpmailer->Password = SMTP_PASS;
} );
Which service to use depends on the client:
| Option | Good fit | Watch out for |
|---|---|---|
| Microsoft 365 SMTP AUTH | Low volume, client already on Microsoft 365 | Disabled by default for newer tenants; Basic authentication is scheduled for deprecation |
| Microsoft 365 SMTP relay | Fixed server IP, any address in an accepted domain | Needs a connector; dynamic IPs are not supported |
| Google Workspace | Client already on Google | Use a dedicated sending account and Google's relay options |
| Transactional email provider | Order emails, higher volume, API sending | Publish its DKIM records and set a custom return path where offered |
Microsoft lists these routes in how to set up a device or application to send email using Microsoft 365. It notes Direct Send only reaches Microsoft 365 recipients, so it is no use for mail to customers. For any provider, follow our process for third-party senders during DMARC projects.
Step 2: Use your own From and put the visitor in Reply-To
From must be an address on your domain, such as website@example.com. Put the visitor's address in Reply-To. Staff can still press Reply and reach the visitor, and DMARC checks only your domain.
This is what the headers are for. RFC 5322 says Reply-To "indicates the address(es) to which the author of the message suggests that replies be sent." Most form plugins have From and Reply-To fields in their notification settings. Set From to a fixed address and map Reply-To to the form's email field.
In code, the same idea with wp_mail() looks like this:
$visitor = sanitize_email( $_POST['email'] );
$headers = array(
'From: Example Website <website@example.com>',
'Reply-To: ' . $visitor,
);
wp_mail( 'info@example.com', 'New contact form submission', $message, $headers );
Validate the visitor's address before you use it, and never let form input add new header lines. To change the site-wide default sender, use the wp_mail_from and wp_mail_from_name filters.
Step 3: Should website mail use a subdomain?
Often, yes. A subdomain such as web.example.com keeps website mail apart from staff mail. It can have its own SPF, DKIM and reputation. A broken form then cannot harm the main domain's reputation, and reports for it are easy to read.
DMARC still works with relaxed alignment: DKIM signed as web.example.com aligns with a From of noreply@web.example.com. A From on the main domain also aligns with relaxed alignment, since both share the same organisational domain. Our guide on using a subdomain or separate domain covers the trade-offs. A typical setup:
web.example.com. TXT "v=spf1 include:spf.provider.example -all"
_dmarc.web.example.com. TXT "v=DMARC1; p=reject; rua=mailto:dmarc-reports@example.com"
Replace the include with the one your provider documents. Contact form notifications that go only to staff can stay on the main domain if that is simpler. Customer-facing mail, such as order emails, benefits most from the split.
How do you test WordPress email authentication?
Send a real message to an external mailbox, open the original message, and read the Authentication-Results header. You want dkim=pass for your domain and dmarc=pass with header.from= your domain. Test every form and every email type, not just one.
A failing message from the web server often looks like this:
Authentication-Results: mx.google.com;
spf=pass smtp.mailfrom=cpuser@server1.host.example.net;
dkim=none;
dmarc=fail (p=REJECT sp=REJECT dis=REJECT) header.from=example.com
Received: from server1.host.example.net (server1.host.example.net [192.0.2.10])
SPF passes, but for the host's domain, and there is no DKIM. A fixed message looks like this:
Authentication-Results: mx.google.com;
dkim=pass header.i=@example.com header.s=s1;
spf=pass smtp.mailfrom=bounces.example.com;
dmarc=pass (p=REJECT sp=REJECT dis=NONE) header.from=example.com
Reply-To: jane@example.org
Check the DNS side with dig too:
dig +short TXT _dmarc.example.com
dig +short TXT example.com | grep "v=spf1"
dig +short TXT s1._domainkey.example.com
Use the selector your provider gives you in place of s1. Our guide to reading email headers explains each field. Then watch DMARC aggregate reports for a week. The web server's IP should stop appearing as a failing source for the domain.
What can you do on shared hosting with cPanel?
On cPanel hosting, PHP mail() hands the message to the server's own mail system. cPanel can sign DKIM and suggest SPF for domains whose DNS it controls. That can make plain WordPress mail pass. It does not fix forms that put the visitor in From.
The Email Deliverability in cPanel interface checks DKIM, SPF and PTR records per domain. It shows suggested records and can repair them when cPanel controls the DNS. If DNS lives elsewhere, such as at Cloudflare or a registrar, copy the suggested records there by hand.
On shared hosting, check these points:
- Is DKIM on for the domain? Open Email Deliverability and confirm the DKIM status is valid.
- Does SPF list the host? Merge the host's suggested mechanism into the single existing SPF record. Never publish a second one.
- Does the domain's mail live elsewhere? If the client uses Microsoft 365 or Google, set Email Routing in cPanel to Remote Mail Exchanger, so the server does not deliver local copies of form mail.
- Is the envelope sender aligned? Check
smtp.mailfromin a real header. If it is the server's host name, rely on DKIM for alignment.
Shared servers share IP reputation with other customers. For anything beyond a low-volume contact form, Step 1 (an authenticated external service) is more reliable. To publish the DMARC record itself, see how to add a DMARC record in cPanel.
How do you fix WooCommerce order emails?
WooCommerce sends order emails through WordPress's mail function, so the Step 1 route applies to them too. Then check the sender fields: set the From address to your own domain under WooCommerce > Settings > Emails, and use the Reply-to option if replies should go to another inbox.
WooCommerce's email settings documentation says the From name and address set "the sender identity customers see on emails sent by WooCommerce". It recommends "using an email address on your site's domain". The Reply-to fields "change where replies are delivered, but they do not change the "From" name or address."
In the WC_Email code reference, the send method uses wp_mail by default and applies the store's From address through the wp_mail_from filter. So an SMTP setup through phpmailer_init also covers order emails.
For store notifications such as new orders, WooCommerce sets Reply-To to the customer by default. That is the right pattern: your From, their Reply-To. Order receipts matter to customers, so consider a transactional provider and a subdomain. Our DMARC for e-commerce guide covers the wider picture.
What are the common WordPress email DMARC mistakes?
Most failures come from the sending route, a visitor's address in From, or a duplicate SPF record. The table maps each symptom to its likely cause and fix. Confirm every fix with a real header, not just a DNS check.
| Symptom | Likely cause | Fix |
|---|---|---|
Form notifications never arrive at p=reject |
Sent from the web server with no aligned SPF or DKIM | Send through an authenticated service (Step 1) |
| Notifications from Gmail visitors vanish | From set to the visitor's address | Fixed From on your domain, visitor in Reply-To |
spf=pass but dmarc=fail |
Envelope sender is the host's domain | Add aligned DKIM, or a custom return path |
SPF permerror in reports |
Second SPF record added for the host or provider | Merge into one record |
| SMTP plugin set up but mail still fails | Plugin From overridden by a form or WooCommerce setting | Align From in every plugin that sends |
| SMTP login errors with Microsoft 365 | SMTP AUTH disabled for the mailbox | Enable it per mailbox, or use relay or a provider |
| Password in the database is exposed | SMTP secret saved in plugin settings | Store it in wp-config.php or an API key with send-only scope |
| Mail works until the client changes host | DKIM was signed by the old server | Re-test after every migration |
What routine should an MSP follow across client websites?
Treat every client website as a named sender in the domain's DMARC project. Record how it sends, who owns the credentials, and when it was last tested. Repeat the test after every hosting, plugin or theme change.
- List every site per client domain, including microsites and staging sites that can send mail.
- Record the route: PHP
mail()on the host, SMTP to the client's mail service, or a transactional provider. - List every sending plugin: forms, WooCommerce, membership, booking and backup alerts.
- Fix the route so all mail leaves through an authenticated service with DKIM for the domain.
- Set From and Reply-To in each plugin. No form may put a visitor's address in From.
- Test each email type to an external mailbox and save the
Authentication-Resultsheader in the client's notes. - Watch aggregate reports at
p=noneuntil the website traffic passes, then move throughp=quarantinetop=reject. RFC 9989 removed the old percentage tag, so there is no ramp. - Re-test after each migration, plugin update or credential change.
The major mailbox providers make this urgent for busy sites. Yahoo asks all senders for SPF or DKIM at a minimum and bulk senders for both plus DMARC. Microsoft rejects non-compliant mail from domains sending over 5,000 messages a day to its consumer mailboxes. A platform such as dmarc.ai shows report sources across all client domains in one view, so a web server that still fails stands out. Start with the DMARC guide for the full rollout.
FAQ
Why do my WordPress contact form emails go to spam?
Usually because they fail authentication. The site sends from the web host's server, which is not in your SPF record and does not sign DKIM as your domain. Many forms also put the visitor's address in From. Send through an authenticated service, use your own From and check the header for dmarc=pass.
Do I need an SMTP plugin for WordPress?
Not necessarily, but you need some way to send through an authenticated service. An SMTP plugin is the easiest route for most sites. A short phpmailer_init hook does the same in code. Some hosts sign DKIM for mail sent with PHP mail(), so test a real message before you decide.
Can the From address be the person who filled in the form?
No. Your server cannot authenticate the visitor's domain, so the message fails that domain's DMARC policy. Use a fixed From on your own domain, such as website@example.com, and put the visitor's address in Reply-To. Staff can still reply directly, and DMARC only checks your domain.
Will moving to p=reject break WordPress email?
It will if the site still sends unauthenticated mail. At p=none, failing mail is usually still delivered, so problems stay hidden. Before you enforce, check aggregate reports for the web server's IP and test every form and order email. Once they show dmarc=pass, step to p=quarantine, then p=reject.
Next steps
Find out how each client site sends mail, move it to an authenticated service with DKIM for the domain, and fix From and Reply-To in every plugin. Then confirm dmarc=pass in real headers before enforcing. The DMARC guide covers the rollout, and adding a DMARC record in cPanel covers the record itself.