WordPress with WP Mail SMTP
WP Mail SMTP: SPF, DKIM and DMARC setup for WordPress
WP Mail SMTP sends WordPress mail through a mailer you connect. See which SPF, DKIM and DMARC records it needs and how to confirm them.
Check your current setup:
How WP Mail SMTP sends WordPress email
WP Mail SMTP is a WordPress plugin that reconfigures the wp_mail() function, so your site sends through an SMTP server or an email provider's API instead of the web server's mail function. The plugin calls that service a mailer. Your SPF, DKIM and DMARC results depend on the DNS records you publish for the mailer you connect.
Existing DMARC policy: authenticating WordPress with WP Mail SMTP does not require resetting it. Keep one _dmarc record, preserve p, subdomain and alignment settings, and merge any needed rua address with existing destinations. The p=none example below is only for a new deployment without a valid record.
Three terms explain the rest of this guide. SPF is a DNS record listing the servers allowed to send for your domain. DKIM is a signature added to each message and checked against a key in your DNS. DMARC tells receiving servers how to treat mail when neither check ties it to the domain in the From address. That tie is called alignment. One aligned check lets a message pass DMARC, and RFC 9989 asks domain owners for at least one and preferably two.
Without a mailer, WordPress uses PHP's basic mail function. Unless a plugin sets another sender, the From address is wordpress@ followed by your site's domain.
Your mailer decides which records you need
WP Mail SMTP documents no include: value or DKIM selector of its own. Those come from the mailer. A few examples:
- Google Workspace / Gmail. The plugin sends through Google's API. SPF uses
include:_spf.google.com. The Google Workspace guide covers DKIM. - SMTP.com. WP Mail SMTP's documentation lists
v=spf1 include:_spf.smtp.com ~allfor SPF and a DKIM TXT record atsmtpcomcustomers._domainkey, with the value copied from SMTP.com. - Mandrill. The documentation shows two DKIM CNAME records, with the example names
mte1._domainkeyandmte2._domainkey. - SendGrid and Brevo. You authenticate the domain in the provider's own panel. Follow the SendGrid guide or the Brevo guide.
- Other SMTP. The records belong to the server you enter, usually your mailbox provider or your host. Ask that provider for its SPF value and whether it signs with DKIM.
- Default (none). WP Mail SMTP describes this option as essentially the same as not using the plugin. Your web host keeps sending.
The plugin changes only what WordPress sends. Your mailboxes and newsletter tools keep their own route, so their SPF entries must stay.
Step 1: Set the From address
- Open WP Mail SMTP » Settings in WordPress.
- In From Email, enter an address on the domain you will authenticate.
- Turn on Force From Email. The address above then applies to all messages and overrides values set by other plugins.
- In your form plugin, put the visitor's address in the Reply-To field.
- Choose your mailer and connect it. The Setup Wizard guides you through this, and some mailers ask you to verify your domain before they send.
Caution: step 3 also replaces the From address set by form and store plugins. Send a test from each form before you rely on it. Before switching production WordPress mail to a new provider, verify its domain authentication. With an existing p=quarantine or p=reject policy, messages lacking both aligned SPF and aligned DKIM can be filtered or rejected. When the option replaces an address and the message has no Reply-To, the plugin uses the original address as Reply-To.
If you use Other SMTP, also turn on Return Path. The plugin then uses the From Email as the envelope sender, the bounce address that SPF checks. SPF can then align when that server is listed in your SPF record. Most API mailers, such as SendGrid, hide this toggle, so plan on DKIM to align there.
Step 2: Publish SPF for the mailer
Publish SPF at the MAIL FROM domain specified by the mailer, which may be your root or a dedicated bounce subdomain. Merge an include: only into the SPF at that exact name. If the mailer supplies subdomain TXT/MX or CNAME records, follow that flow; adding its include at the root does not authenticate a different MAIL FROM domain.
- Look up your current record with the SPF checker.
- Only at that MAIL FROM name, merge the required
include:before the final~allor-all. Preserve other senders. If no SPF exists there, use the mailer’s full record; do not create root SPF merely because the From address uses the root. - Keep the entries for your mailboxes and other senders.
With Google Workspace mailboxes and SMTP.com for WordPress, the record would be:
v=spf1 include:_spf.google.com include:_spf.smtp.com ~all
Caution: a domain can publish only one SPF record. With two records, the SPF check returns permerror and SPF stops passing for all your mail. SPF also allows at most 10 terms that trigger DNS lookups, and each include: counts along with the lookups inside it. Leave the ending as it is while you test. Changing ~all to -all turns every unlisted sender into a hard failure.
Step 3: Turn on DKIM at the mailer
DKIM signs each message with a key the mailer holds. The free plugin has no DKIM setting, so this work happens in your mailer's account and your DNS.
- Open domain authentication in your mailer's account.
- Add the records exactly as shown. Some DNS panels add your domain to the host name automatically, so enter only the part they ask for.
- Allow up to 48 hours for DNS changes, then confirm the verification in the mailer's panel.
With Other SMTP, DKIM exists only if the connected server signs the message. DMARC looks at the domain in the signature. A message signed with your provider's domain passes DKIM and still fails alignment. With the default relaxed alignment, a subdomain such as mail.example.com aligns with a From address at example.com.
Step 4: Add the DMARC record
WordPress DMARC record
You publish DMARC at your DNS provider. WordPress and the plugin do not touch this record.
- Log in to the service that hosts your DNS. It is usually your hosting panel, your registrar or your CDN.
- Check
_dmarcin your DNS panel. If a DMARC record exists, preserve its policy and report addresses; do not replace it with the starter example below. If none exists, create one TXT record named_dmarc. Multiple DMARC records at one name are all discarded. - Use the value below with an address you control, or build one with the DMARC generator.
New policy only: use this starter value only when no valid DMARC record exists. For an existing record, keep its policy and merge the report address instead of pasting over the value.
v=DMARC1; p=none; rua=mailto:dmarc@example.com
p=none expresses no preference, so it does not ask receiving servers to block anything. RFC 9989 says domain owners usually start there, with rua pointing at the mailbox that collects aggregate reports. Those are XML summaries of which sources sent mail using your domain and whether they passed.
Preserve existing policy during authentication. For a new policy, start at p=none and collect representative reports, which may take months. After fixing all legitimate streams, consider p=quarantine and observe reports again. Evaluate p=reject separately: it is optional, needs aligned DKIM rather than SPF alone, and RFC 9989 §7.4 advises against it when users post to mailing lists. Forwarding and list transformations need testing; receiving servers decide the final disposition. RFC 9989 removed pct from the current policy format.
Step 5: Confirm with the Email Test
- Go to WP Mail SMTP » Tools and open the Email Test tab.
- Send a test to a mailbox you can read. If the plugin finds an SPF, DKIM or DMARC problem, you see Domain Check Results with the fix.
- Open the message headers and paste them into the email header analyzer. Look for
dkim=passwithheader.d=showing your domain, and fordmarc=pass.
The same domain check runs at the end of the Setup Wizard, and Tools > Site Health shows the last result. To run it, the plugin sends your From address, mailer and sending domain to its own service.
If you run WooCommerce
WooCommerce sends store email with wp_mail(), so those messages follow the mailer you connected in WP Mail SMTP. WooCommerce documents no include: value and no DKIM selector of its own, and DKIM alignment for order emails depends on that mailer.
In WooCommerce > Settings > Emails, the "From" name and "From" address fields sit below the list of email notifications. Use an address on your own domain, because WooCommerce warns that public addresses such as Gmail can be filtered as spam or blocked. With Force From Email on, the address in WP Mail SMTP is the one that goes out.
Order confirmations are mail your customers expect. Place a test order and check its headers before you raise DMARC above p=none.
Common problems
- Form messages fail DMARC. The form puts the visitor's address in From. Yahoo and AOL, for example, publish
p=reject, and your site cannot authenticate their domains. Turn on Force From Email and move the visitor's address to Reply-To. - The domain now has two SPF records. Merge them into one
v=spf1record. Do not leave both published. - DKIM passes and DMARC fails. The signature uses your provider's domain. Finish domain authentication at the mailer until
header.d=shows your domain. - Reports still show your web host. The plugin reconfigures
wp_mail()only. Scripts that call PHP's mail function directly keep leaving by the old route. Also confirm the mailer is not still set to Default (none). SMTP connect() failed. WP Mail SMTP points to a wrong port, security setting or host, or to your web server blocking the outbound connection. Many shared hosts block certain ports, so ask your host.SMTP Error: Could not authenticate.The SMTP username or password is wrong, or the host requires a different authentication method. DNS records will not change this error.- Force From Email is grayed out. WP Mail SMTP says your selected mailer already forces the From Email site-wide.
- Mail from the Backup Connection fails DMARC. This Pro feature sends through a second mailer when the primary one fails. Authenticate your domain with that second mailer too.