# WordPress not sending email? How to fix it with SMTP, SPF and DKIM

> Why WordPress emails go missing or land in spam, and how to fix it: send through SMTP, set up SPF, DKIM and DMARC, use the right From address, and log every email.

Guide 4 min read · Updated 24 November 2026


Password resets that never arrive, order emails in spam, contact forms that go nowhere. It is almost always the same cause, and the fix takes about twenty minutes.

WordPress sends email for password resets, new user sign-ups, comment notifications, form submissions and, on WooCommerce, every order. When those emails disappear, people can’t log in and customers think their order failed. Here is why it happens and how to fix it for good.

## Why WordPress email goes missing

By default, WordPress hands email to PHP’s `mail()` function, which passes it to whatever mail program your web server has. That has two problems:

- **Many hosts don’t send it at all,** or rate-limit it heavily to stop spam from hacked sites.
- **When it is sent, it isn’t trusted.** The email claims to come from your domain, but it leaves from a shared web server that your domain never authorised. Gmail, Outlook and Yahoo check for exactly this, and file the email in spam or reject it.

On top of that, the default sender is `wordpress@yourdomain.com`, an address that often doesn’t exist, which makes filters even more suspicious.

## The fix: send through a real mail server (SMTP)

SMTP lets WordPress log in to a proper mail server, the same way your email app does, and send through it. The receiving server sees mail coming from a server your domain authorises, and delivers it.

You need four things from your email provider: the SMTP **host** , the **port** (587 with TLS is standard; 465 with SSL also works), a **username** and a **password** or API key. Common setups:

- **Google Workspace or Gmail:** smtp.gmail.com, port 587, TLS. You need an app password, not your normal password.
- **Microsoft 365:** smtp.office365.com, port 587, TLS. SMTP authentication must be enabled for the mailbox.
- **SendGrid:** smtp.sendgrid.net, port 587. The username is literally `apikey`; the password is your API key.
- **Amazon SES:** the SMTP endpoint for your region, with SMTP credentials created in the SES console (not your AWS keys).
- **Mailgun, Postmark, Brevo, Zoho:** each lists its host and port in its dashboard.

[SMTP](https://togglework.app/features/email/smtp/) has presets for these that fill in the host, port and encryption. To keep the password out of the database, you can define it in wp-config.php instead.

[![SMTP settings screen in the Toggleworks WordPress plugin, showing Provider preset, SMTP host, Port, Encryption](https://togglework.app/wp-content/themes/toggleworks-site/assets/img/parts/email-smtp.webp?v=1795524185)](https://togglework.app/features/email/smtp/)

SMTP: pick your provider’s preset, then add the username and password.

## Set the From address properly

Use a real address on your own domain, such as `hello@yourdomain.com` or `orders@yourdomain.com`, and verify that domain with your SMTP provider. Most providers refuse to send from addresses they haven’t verified. Set a From name people recognise: your shop or site name, not “WordPress”.

Other plugins (forms, WooCommerce) sometimes set their own sender. If emails still arrive from a different address, force your sender for every email.

## Authenticate your domain: SPF, DKIM and DMARC

These three DNS records prove to receiving servers that your mail is genuine. Since 2024, Gmail and Yahoo require them from anyone sending in bulk, and they help everyone else.

- **SPF** lists the servers allowed to send for your domain. Your provider tells you what to add, for example `include:_spf.google.com`. Keep it to *one* SPF record per domain; merge providers into it.
- **DKIM** signs each email with a key published in your DNS. Your provider generates the record; you add it.
- **DMARC** tells receivers what to do when SPF or DKIM fail. Start with `v=DMARC1; p=none; rua=mailto:you@yourdomain.com` to get reports, and tighten to `quarantine` once everything passes.

## Test it, then keep a log

Send a test email to a Gmail address. Open it, choose “Show original”, and check that SPF, DKIM and DMARC all say PASS.

Then keep a log of every email WordPress sends: recipient, subject, whether it went out, and the error if it didn’t. When a customer says “I never got my receipt”, you can see in seconds whether it was sent and resend it with one click. [Email Log](https://togglework.app/features/email/email-log/) does this, and redacts password-reset keys so the log can’t be used to take over accounts.

[![Email Log settings screen in the Toggleworks WordPress plugin, showing Store the message body, Redact password-reset and activation keys, Keep entries for (days)](https://togglework.app/wp-content/themes/toggleworks-site/assets/img/parts/email-email-log.webp?v=1795524182)](https://togglework.app/features/email/email-log/)

Email Log: every email WordPress sent, with status and one-click resend.

## Protect your sender reputation

- **Stop emailing addresses that bounce.** Repeated sends to dead addresses hurt your reputation with mailbox providers. [Email Blocklist & Bounce Suppression](https://togglework.app/features/email/email-blocklist/) suppresses them.
- **Silence staging sites.** A copy of a live shop can email real customers about fake orders. [Mail Control (Test Mode)](https://togglework.app/features/email/mail-control/) stops all outgoing email on a site, or sends every email to one address of yours instead.
- **Don’t send newsletters through WordPress.** Use a newsletter service for bulk mail and keep your SMTP server for transactional email.

## Still not working?

1. Check the log for the error. “Authentication failed” means the username or password; “connection timed out” usually means your host blocks the port (try 587 and 465, or ask your host).
2. Make sure only one plugin is configuring SMTP. Two will override each other.
3. Check the From domain is verified with your provider.
4. Look up your domain on a blocklist checker if mail was sent from the server before you switched.

Written by the Toggleworks team, who build and support a WordPress plugin used for exactly these jobs. We keep this guide plugin-neutral: every step works with any tool, or none.

## Doing this with Toggleworks

Every step above that needs a plugin is a part of Toggleworks. Each one is off until you switch it on, and all of them come in every plan.

- [SMTP](https://togglework.app/features/email/smtp/) — TW-EML-05 · Send all WordPress email through an SMTP server (Gmail, Office 365, SendGrid, Mailgun, SES and more) instead of PHP mail(). · 12 settings
- [Email Log](https://togglework.app/features/email/email-log/) — TW-EML-02 · Keep a searchable record of every email WordPress sends, with delivery status, errors and one-click resend. · 3 settings
- [Mail Control (Test Mode)](https://togglework.app/features/email/mail-control/) — TW-EML-04 · Stop all outgoing email, or send every email to one address instead. Ideal for staging and development sites. · 3 settings
- [Email Blocklist & Bounce Suppression](https://togglework.app/features/email/email-blocklist/) — TW-EML-01 · Never send email to addresses or domains you list, and automatically stop emailing addresses that bounce permanently. Protects… · 2 settings

## Questions

**Which SMTP service should I use?**

For a site that sends a few hundred emails a day, your existing email host (Google Workspace, Microsoft 365, Zoho) works if it allows SMTP. Stores and busier sites do better with a transactional service such as Postmark, Amazon SES, Mailgun, Brevo or SendGrid, which are built for automated mail and give you delivery reports.

**Can I use a Gmail address as the sender?**

Only if you send through Gmail’s own SMTP server with that account. Sending “from” a gmail.com address through any other server fails Gmail’s DMARC policy and will be rejected or binned. Use an address on your own domain.

**Why do my emails still go to spam after setting up SMTP?**

Check three things: the From address is on a domain you have verified with your SMTP provider; SPF and DKIM pass (look at the headers of a received email, or use a mail-tester service); and the content isn’t spammy (all-caps subjects, link shorteners, a single image with no text).

**How do I stop a staging site emailing real customers?**

Turn on a mail test mode on staging that stops outgoing email, or redirects every email to your own address. It is the first thing to do after copying a live shop to staging.

## More guides

- The WordPress security checklist, in the order that matters5 min read
- How to speed up a WordPress site, in the right order5 min read
- The technical WordPress SEO checklist4 min read
- How to back up a WordPress site properly3 min read

## Switch off the plugin pile.

All 188 parts, one license, updates and support. 14-day refund.

[Choose a plan](https://togglework.app/pricing/#plans) [Try the live demo](https://togglework.app/demo/)

---

Source: https://togglework.app/guides/wordpress-not-sending-email/
