To fix WordPress email that never arrives or lands in spam, send it through SMTP from your own domain instead of your web host. Install WP Mail SMTP or FluentSMTP, pick Other SMTP, and enter smtp.ownmailserver.com, port 587, TLS, any username and an OwnMailServer API key as the password. Force the From address to one on your verified domain, then send a test. It takes about fifteen minutes.
Why WordPress email goes missing
WordPress sends every email, from contact forms and new-user notices to password resets and WooCommerce receipts, through one function, wp_mail(). Out of the box, that hands the message to PHP's mail() on your web host. Three things usually go wrong:
- No DKIM for your domain. The host's server can't sign as your domain, so the message has no proof it's really from you.
- SPF fails or is missing. The mail leaves from a shared hosting server that isn't in your SPF record.
- A generic sender. WordPress defaults to
wordpress@yourdomain.com, an address nobody reads, often on a domain with no DMARC record.
Since 2024, Gmail and Yahoo require authentication for the mail they accept, so unauthenticated WordPress email is sent to spam or dropped without a bounce. You don't get an error, and customers don't get their receipt.
Routing wp_mail() through an SMTP service on your verified domain fixes all three: we sign every message with your DKIM key, send it from IPs in your SPF record, and align it for DMARC.
What you need before you start
- An approved OwnMailServer account with a verified sending domain. The From address must be on that domain, or we refuse the email with
550. - An API key, created in your dashboard under API keys & SMTP. Choose Sending only (the default), limited to your sending domain, since WordPress only sends. Make one for each site, so you can revoke one without breaking the others.
- Admin access to WordPress.
Option 1: WP Mail SMTP
- Install and activate WP Mail SMTP from Plugins, then Add New.
- Open WP Mail SMTP, then Settings, and the General tab.
- Fill in the sender, then choose Other SMTP as the mailer:
| Field | Value |
|---|---|
| From Email | hello@yourdomain.com (on your verified domain) |
| Force From Email | On |
| From Name | Your business name |
| Return Path | On ("Set the return-path to match the From Email") |
| Mailer | Other SMTP |
| SMTP Host | smtp.ownmailserver.com |
| Encryption | TLS |
| SMTP Port | 587 |
| Authentication | On |
| SMTP Username | ownmailserver (we accept any value) |
| SMTP Password | Your API key |
- Click Save Settings.
- Go to WP Mail SMTP, then Tools, then Email Test, enter an address you can check, and click Send Email.
TLS here means STARTTLS on port 587, which is what we require. Don't pick SSL: that's for port 465, which we don't offer. WP Mail SMTP recommends keeping the password out of the database with constants in wp-config.php; its documentation lists them.
Option 2: FluentSMTP
FluentSMTP is free in full, including an email log and a fallback connection.
- Install and activate FluentSMTP, then open Settings, then FluentSMTP, and add a connection.
- Choose Other SMTP and enter:
| Field | Value |
|---|---|
| From Email | hello@yourdomain.com |
| Force From Email | On |
| From Name | Your business name |
| Return-path | On ("Set the return-path to match the From Email") |
| SMTP Host | smtp.ownmailserver.com |
| SMTP Port | 587 |
| Encryption | TLS |
| Use Auto TLS | On |
| Authentication | On |
| SMTP Username | ownmailserver |
| SMTP Password | Your API key |
- Save the connection. FluentSMTP tries to connect and shows an error on the form if it can't.
- Send a test email from FluentSMTP's test screen.
For the password, FluentSMTP can store it in the database or in wp-config.php instead. The second keeps it out of database backups.
Option 3: No plugin, with phpmailer_init
WordPress uses PHPMailer under wp_mail() and lets you configure it with the phpmailer_init hook. Put the key in wp-config.php, above the "That's all, stop editing!" line:
define( 'OMS_API_KEY', 'your-api-key' );
Then create wp-content/mu-plugins/ownmailserver-smtp.php. Must-use plugins load automatically and can't be switched off by mistake from the Plugins screen:
<?php
/**
* Plugin Name: OwnMailServer SMTP
* Description: Sends wp_mail() through smtp.ownmailserver.com.
*/
add_action( 'phpmailer_init', function ( $phpmailer ) {
$phpmailer->isSMTP();
$phpmailer->Host = 'smtp.ownmailserver.com';
$phpmailer->Port = 587;
$phpmailer->SMTPSecure = 'tls'; // STARTTLS
$phpmailer->SMTPAuth = true;
$phpmailer->Username = 'ownmailserver';
$phpmailer->Password = OMS_API_KEY;
} );
// Every email from your verified domain, whatever the sending plugin asks for.
add_filter( 'wp_mail_from', fn() => 'hello@yourdomain.com' );
add_filter( 'wp_mail_from_name', fn() => 'Your Business' );
There's no test button this way, so trigger a password reset for your own account and check that it arrives. If it doesn't, the reason is in your OwnMailServer dashboard or in the reply codes below.
Fix contact form From addresses
This is the most common failure after setup. Many contact forms set From to the visitor's email, so the message looks like it came from them. We only send from your verified domains, so we refuse it, and if we didn't, Gmail would reject it for failing DMARC.
In your form plugin's notification or email settings:
- Set From to an address on your domain, such as
forms@yourdomain.com. - Set Reply-To to the visitor's email field.
WPForms, Gravity Forms and Fluent Forms have a Reply-To field in each notification. In Contact Form 7, add Reply-To: [your-email] to Additional headers on the form's Mail tab. You still press Reply and answer the visitor directly. The plugins' Force From settings above also stop the From problem, but set Reply-To anyway, or replies go to your own address.
WooCommerce emails
WooCommerce sends order confirmations, receipts and account emails through wp_mail(), so they go out through SMTP with no extra setup. Under WooCommerce, then Settings, then Emails, set the sender name and address to match your verified domain so they're consistent with Force From.
A shop's email volume is usually far below our limits, but a new account has a daily warm-up cap that starts at a few hundred recipients and grows with each clean day (how warm-up works). If you send a newsletter from the same site, send it through a newsletter tool, not WordPress, and keep it off the domain your receipts use, or use a subdomain for it.
If it doesn't work
| You see | Cause | Fix |
|---|---|---|
| Connection timed out | Your host blocks outbound port 587 | Ask your host to allow SMTP to smtp.ownmailserver.com:587 |
535 authentication failed |
The password isn't a valid API key | Paste the full key, or create a new one |
550 domain isn't verified |
The From address, or the Return-Path, is on another domain | Turn on Force From Email and Return Path, with an address on your verified domain |
550 awaiting approval |
Your account is still being reviewed | Wait for approval, usually within one business day |
450 |
Warm-up cap or 10 messages a second reached | The plugin can retry later; check the cap in your dashboard |
After 5 failed logins from one IP address we block that address for 15 minutes. On shared hosting your site shares that address with others, so fix a wrong password before testing again.
When this isn't the right fit
If your site sends a few dozen emails a month, many SMTP providers' free tiers cover it, and what matters is that you use SMTP at all. If you also want the domain checked end to end, including SPF, DKIM, DMARC and your other senders, our Deliverability Fix does that on whatever provider you use. Sending through us is $0.20 per 1,000 emails with a $10 monthly minimum that covers the first 50,000, and every email's delivery, bounce or complaint shows up in your dashboard.