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
fromaddress is often something like[email protected], 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, what DKIM does and what DMARC is. If your DNS is on Cloudflare, use the Cloudflare guide.
Step 2: create a sender mailbox or API key
You have two ways to connect WordPress.
SMTP. Create a mailbox such as [email protected] 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 shows the request shape; the API guide has PHP.
For most sites, SMTP is the practical choice.
Step 3: install an SMTP plugin
The most common one is WP Mail SMTP.
- In WordPress, go to Plugins, Add New, search for WP Mail SMTP and install it.
- Open its settings and set From Email to your mailbox address. Turn on Force From Email, which stops other plugins from overriding it.
- Choose Other SMTP as the mailer.
- Enter your SMTP host name from your provider (the mailbox setup guide lists the one for Mailions).
- Set encryption to TLS and the port to 587.
- Turn Authentication on. The username is your full email address and the password is the mailbox password.
- 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 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 [email protected] but logs in as [email protected], 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 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 and tell us your domain. We create the trial, and the panel gives you the DNS records and the exact SMTP settings.