# WordPress not sending email? How to fix it for good

> Why WordPress contact forms and password resets never arrive, and how to fix it with SMTP or an email API, SPF and DKIM, and a proper test.

Published 2026-10-17. Source: https://www.mailions.com/blog/wordpress-not-sending-email

You fill in your own contact form to test it. Nothing arrives. A customer says the password reset never showed up. Your hosting company says "email is working". All three can be true at once, and the fix is the same each time.

## Why WordPress email fails

By default WordPress sends mail with PHP's `mail()` function, which hands the message to the web server it's running on. That server is almost never set up to be trusted by other mail providers. Specifically:

- The message isn't signed with DKIM.
- The sending IP isn't in your SPF record, or you don't have one.
- The server's IP is shared with hundreds of other sites, and some of those are sending junk.
- Many hosts limit or block `mail()` to stop abuse.
- The `from` address is often something like `wordpress@yourdomain.com`, which doesn't exist as a mailbox.

Gmail, Outlook and Yahoo see an unsigned message from an untrusted IP and send it to spam, or reject it without telling you. WordPress thinks it succeeded, because `mail()` only reports that the server accepted the message.

## The fix in one sentence

Stop using `mail()`. Send through a real mail service with authentication, from an address on a domain with SPF, DKIM and DMARC set up.

## Step 1: authenticate your domain

Before touching WordPress, set up the domain properly. Publish SPF, DKIM and DMARC records for it, and check them. The basics are in [what an SPF record is](/blog/what-is-spf-record), [what DKIM does](/blog/what-is-dkim) and [what DMARC is](/blog/what-is-dmarc). If your DNS is on Cloudflare, use [the Cloudflare guide](/help/dns-cloudflare).

## Step 2: create a sender mailbox or API key

You have two ways to connect WordPress.

**SMTP.** Create a mailbox such as `noreply@yourdomain.com` and let WordPress log in to it. This works with any plugin and is the easiest to set up.

**An HTTP API.** Create an API key and call it from code. This avoids SMTP port blocks, but needs a plugin or custom code that supports it. Our [Node.js post](/blog/send-email-nodejs) shows the request shape; the [API guide](/help/sending-api) has PHP.

For most sites, SMTP is the practical choice.

## Step 3: install an SMTP plugin

The most common one is WP Mail SMTP.

1. In WordPress, go to **Plugins**, **Add New**, search for **WP Mail SMTP** and install it.
2. Open its settings and set **From Email** to your mailbox address. Turn on **Force From Email**, which stops other plugins from overriding it.
3. Choose **Other SMTP** as the mailer.
4. Enter your SMTP host name from your provider (the [mailbox setup guide](/help/mailbox-setup) lists the one for Mailions).
5. Set encryption to **TLS** and the port to **587**.
6. Turn **Authentication** on. The username is your full email address and the password is the mailbox password.
7. Save.

The plugin's **Email Test** tab sends a message to any address you choose. Send one to Gmail and open **Show original** to check SPF, DKIM and DMARC all pass. If you don't understand the ports, [SMTP and IMAP ports explained](/blog/smtp-ports-explained) fills the gap.

## Step 4: make the from address honest

Use one consistent from address that exists and that you read, or at least that has a working mailbox behind it. The sender and the SMTP login should be the same address, or at least the same domain. If WordPress says the mail comes from `a@yourdomain.com` but logs in as `b@otherdomain.com`, DMARC alignment fails.

For contact-form plugins, don't set the visitor's address as the From. Keep From as your own address and put the visitor's address in **Reply-To**. Otherwise you're sending mail that claims to be from someone else's domain, which is what spoofing looks like to a filter.

## Step 5: test the real flows

Don't stop at the plugin's test button. Run each flow once:

- Submit the contact form
- Reset a password for a test user
- Place a test order, if you run a shop
- Register a new account

During testing, use a throwaway address instead of cluttering your own inbox. Mailions's [public temporary inboxes](/temp) need no sign-up. Free ones delete mail after 30 minutes and anyone who knows the address can read it, so use dummy data.

## Still failing?

**"Could not connect to SMTP host."** Your hosting company may block outgoing port 587 or 25. Ask them, or switch to an HTTP API plugin.

**"Authentication failed."** Check the username is the whole address and the password hasn't been mangled by a password manager.

**Forms work but mail goes to spam.** Authentication or content. Check the headers first.

**Emails send twice.** Two plugins are both sending. Look for another SMTP or email-log plugin and disable one.

## Where to get a mailbox

WordPress needs a mailbox or API key on your domain that is set up and reachable. If you'd like one, [contact us](/contact) and tell us your domain. We create the trial, and the panel gives you the DNS records and the exact SMTP settings.

## Frequently asked questions

### Why is WordPress not sending emails?

By default WordPress uses PHP `mail()`, which many hosts block or which sends without SPF and DKIM for your domain. Messages then never leave the server or land in spam. Sending through authenticated SMTP or an email API fixes it.

### What is the best way to send email from WordPress?

Install an SMTP plugin such as WP Mail SMTP, connect it to a mailbox or email service on your own domain, and set the From address to that domain. Then send a test and check that SPF, DKIM and DMARC pass.

### Why are WordPress contact form emails going to spam?

Often the form sends "from" the visitor's address, which fails authentication for your domain. Send from your own address instead and put the visitor's address in Reply-To.
