WordPress not sending email: SMTP, SPF and DKIM explained
· The AYT team · 5 min read

WordPress sends email through the wp_mail() function, which by default uses PHP's mail() function on the server. The messages either never leave (the server has no mail setup, or the host blocks it) or leave with no proof that they're allowed to come from your domain, and end up in spam. The lasting fix: send over SMTP, authenticated with a real mailbox on your domain, and have SPF, DKIM and DMARC set up in DNS.
Why WordPress emails don't arrive
The causes, roughly in the order you'll meet them:
- The domain has no SPF or DKIM. Since February 2024, Gmail requires every sender to have at least SPF or DKIM, and senders of more than 5,000 messages a day to have both plus DMARC. An unauthenticated message goes to spam or is rejected.
- The sender address doesn't exist. Unless told otherwise, WordPress sends from
wordpress@yourdomain.com, an address nobody usually created. - The contact form puts the visitor's address in the "From" field. The message claims to come from
customer@gmail.combut leaves from your server, and Gmail rejects it because it fails DMARC. mail()is disabled or limited on the server. Some hosts switch it off entirely so it can't be used for spam.- The server's IP is on a blocklist, usually on shared hosting where another site sent spam.
How to find where the problem is
Send yourself a test email, for example with "Lost your password?" on the login page, to a Gmail address. If it doesn't reach Spam either, the message never leaves the server (causes 4 and 5). If it lands in Spam, open it, choose "Show original" from the message menu and look at the SPF, DKIM and DMARC lines: each one shows PASS or FAIL.
An SMTP plugin with a sending log saves you the guesswork. FluentSMTP keeps a free log of sent messages and errors, so you can see exactly which form sent what and why it failed.
The fix: SMTP with a mailbox on your domain
- Create a mailbox for the site in your hosting panel, for example
site@yourdomain.com. Don't use your personal mailbox: change its password and the site stops sending. - Install an SMTP plugin. The most used ones in the WordPress.org directory are WP Mail SMTP (made by the WPForms team) and FluentSMTP (free, no Pro version).
- Choose the "Other SMTP" connection in WP Mail SMTP, or the generic SMTP connection in FluentSMTP, and fill in the details from your provider: the SMTP server, port 587 with TLS (STARTTLS) or port 465 with SSL, authentication on, the full email address as username, and the mailbox password.
- Set "From Email" to the same address and tick the option that forces it on every message ("Force From Email" in WP Mail SMTP), so no plugin sends from another address. Put your company name in "From Name".
- Send a test email from the plugin's page.
WP Mail SMTP lets you keep the password in wp-config.php instead of the database, useful when several people have wp-admin access.
For large volumes (newsletters, a shop with many orders a day), a transactional sending service such as Brevo, Mailgun, Postmark or Amazon SES is worth it. Both plugins have connectors for them.
SPF, DKIM and DMARC in short
SMTP takes care of sending, but the receiving server checks your domain's DNS to see whether the message is allowed to come from there. You need three TXT records:
| Record | Where | What it says |
|---|---|---|
| SPF | the domain, e.g. v=spf1 a mx ~all |
which servers may send for the domain |
| DKIM | selector._domainkey.yourdomain.com |
the public key that checks the message's signature |
| DMARC | _dmarc.yourdomain.com, e.g. v=DMARC1; p=none |
what the recipient does with messages that fail the checks |
A domain may have only one SPF record. If you add a transactional service, put its include: in the same record, not a new one: two SPF records make the check fail for every message. All the details, with examples, are in the guide to SPF, DKIM and DMARC.
Contact forms: From and Reply-To
The form's message has to leave from the site's address. The visitor's address goes in "Reply-To", so you can answer them directly by pressing Reply.
In Contact Form 7, for example, in the "Mail" tab keep your own address in "From", Site <site@yourdomain.com>, and add to "Additional headers":
Reply-To: [your-email]
The same rule applies to WPForms, Gravity Forms and WooCommerce notifications: the sender is always an address on your own domain.
Frequently asked questions
Can I send through my Gmail account?
Technically yes, but the messages leave from @gmail.com and don't align with the site's domain, and Google requires an app password or OAuth sign-in. For a business site, a mailbox on your own domain is the right choice.
WooCommerce emails land in spam. Is that a different problem?
No, it's the same one. WooCommerce also sends through wp_mail(), so SMTP and the SPF, DKIM and DMARC records fix order confirmations too.
WordPress email on AYT hosting
On AYT WordPress hosting you get mailboxes on your domain, with IMAP, SMTP and webmail, which you can use straight away in the SMTP plugin. The panel sets up SPF, DKIM and DMARC, and the Email Deliverability page shows whether the records are in order.

To keep the server off spam lists, each account has an hourly limit on messages sent. If you want to read the mailbox on your phone or in Outlook, the steps are in the guide to email on your domain.
