2026年11月12日
2026年11月12日
WordPress Confirmation Emails Not Arriving: Test Sending, From, then SPF
This article is a localized edition of the Japanese original. Read the Japanese original
When WordPress confirmation emails (user registration, password reset, admin email address change and so on) do not arrive, check in this order: is mail being sent → is the From address accepted by the receiving side → did it land in spam. Most often, mail sent directly from the server fails the SPF or DKIM check for the sender domain and is rejected or filtered into spam by the receiver.
This article explains how to narrow down where mail is getting stuck, and how to move ahead with registrations and address changes even while mail is not arriving.
The main confirmation emails WordPress sends
| Sent when | Recipient | |
|---|---|---|
| New user notification (with a link to set a password) | A user registers, or an administrator adds a user | The registered user (the administrator is notified too) |
| Password reset | "Lost your password?" on the login screen | That user |
| Admin email address change confirmation | When you change the administration email address in Settings → General | The new address |
| User email address change confirmation | When you change the email address in a profile | The new address |
All of them are sent by the same function, wp_mail(). Checking first whether only one type fails or all of them do makes it easier to narrow down the cause.
Step 1: Check that mail is being sent
If you can use WP-CLI, send a test email to an address you can receive.
wp eval 'var_dump( wp_mail( "you@example.net", "WordPress send test", "This is a test." ) );'
bool(true)means WordPress finished its sending process. It does not mean the message reached the recipient. If it does not arrive, go on to Step 3.bool(false)means sending failed within WordPress. Check the error in Step 2.
If you cannot use WP-CLI, requesting a password reset from the login screen gives you the same check.
Step 2: Log sending errors
When wp_mail() fails, the wp_mail_failed action fires. Temporarily add the following code to your child theme's functions.php or a mu-plugin to log the error.
<?php
// Write wp_mail sending failures to the PHP error log (remove when you are done investigating)
add_action( 'wp_mail_failed', function ( WP_Error $error ) {
error_log( 'wp_mail failed: ' . $error->get_error_message() );
} );
The log goes to the server's PHP error log, or to wp-content/debug.log when WP_DEBUG and WP_DEBUG_LOG are set to true in wp-config.php. Common messages and their causes:
| Example message | Main cause |
|---|---|
Could not instantiate mail function. |
The server's mail() (sendmail) is unavailable or disabled |
SMTP Error: Could not connect to SMTP host. |
Wrong SMTP host name, port or encryption setting, or the outgoing port is blocked |
Messages starting with Could not execute: |
The server's sendmail path does not exist or cannot be executed |
SMTP Error: Could not authenticate. |
Wrong SMTP username or password |
Messages starting with Invalid address: and containing (From) |
The From address is malformed |
Step 3: Check the From address
If no sender is specified, WordPress uses wordpress@ plus the site's domain (without a leading www.) as the From address. For example, if the site is https://www.example.com, it is wordpress@example.com.
If that address does not exist, or the server sending the mail is not included in the domain's SPF record, the receiver may reject the message or put it in spam. Major providers such as Gmail require sender domain authentication (SPF or DKIM).
There are two fixes.
- Send from a real mail account with an SMTP plugin (recommended). Because mail is sent with authentication to a mail server or sending service, SPF and DKIM match the domain's regular mail.
- Change only the From address. Use this when mail is sent directly from the server and the server is included in that domain's SPF record.
The code to change the From address is below. Replace noreply@example.com with an address on your own domain.
<?php
// Use an address on your own domain as the sender
add_filter( 'wp_mail_from', function () {
return 'noreply@example.com';
} );
// Use the site name as the sender name
add_filter( 'wp_mail_from_name', function () {
return get_bloginfo( 'name' );
} );
If you send through an SMTP plugin, the plugin's settings decide the sender, so do not add this code (with both in place, it is hard to tell which one is in effect).
Sending with an SMTP plugin
Install an SMTP plugin such as WP Mail SMTP and set the mail server's host name, port (usually 587 with STARTTLS or 465 with SSL/TLS), username and password. With WP-CLI you can install it with the following command.
wp plugin install wp-mail-smtp --activate
After configuring it, send a message with the plugin's test email feature (Email Test under Tools in WP Mail SMTP) and check whether it arrives or shows an error. For details, see Sending WordPress mail via SMTP.
Step 4: Check SPF, DKIM and the receiving side
Once a test email arrives, look at the Authentication-Results line in the received message's headers (in Gmail, "Show original"). If it says spf=pass and dkim=pass, the message passed sender domain authentication. If you see fail or none, check the DNS of the sender domain.
# SPF (a TXT record starting with v=spf1)
dig +short TXT example.com
# DMARC
dig +short TXT _dmarc.example.com
Check that the SPF record includes the server or service sending the mail. If you use an SMTP sending service, add the SPF and DKIM records as that service instructs.
Also check the following on the receiving side.
- Did it land in the spam folder?
- For company or school addresses, is the receiving side's filter stopping it? (Ask the administrator to check the logs.)
- Links in confirmation emails expire. Use the link in the most recent email, not an old one.
Moving ahead while mail is not arriving
A registered user does not get the set-password email
An administrator can hover over the user in Users → All Users and resend with "Send password reset". If mail does not arrive at all, the administrator can set a password with "Set New Password" on the user's edit screen and tell the user by another channel. With WP-CLI, set it with a prompt so the password does not stay in the command history.
wp user update 12 --prompt=user_pass
12 is the user ID (you can find it with wp user list).
The admin email change confirmation does not arrive
When you change the administration email address in Settings → General, a confirmation email is sent to the new address, and the old address stays in effect until the link is opened. The pending value is stored in the new_admin_email and adminhash options. If you cannot receive the confirmation, change it directly with WP-CLI and delete the pending values.
# Check the pending new address
wp option get new_admin_email
# Change the admin email address directly and delete the pending values
wp option update admin_email 'new@example.com'
wp option delete new_admin_email adminhash
Changing it directly does not confirm that the new address can receive mail. After the change, send the Step 1 test email to the new address and confirm it arrives. A safe way to change it is explained in How to change the WordPress admin email address safely.
Order of checks (summary)
- Send a test email with
wp evaland see whether it returnstrueorfalse. - If
false, log the error withwp_mail_failedand fix whethermail()is available or whether the SMTP settings are correct. - If
truebut nothing arrives, check the From address and the SPF and DKIM of its domain. Sending from a real account through an SMTP plugin usually solves it. - Check the spam folder and filters on the receiving side.
- If it is urgent, set the password or admin email address directly in the admin area or with WP-CLI and carry on.
Related articles
- Sending WordPress mail via SMTP
- Fixing WordPress wp_mail sending errors
- How to change the WordPress admin email address safely
References: wp_mail() (WordPress Developer Resources), wp_mail_failed (WordPress Developer Resources), Email sender guidelines (Gmail Help)
Questions about WordPress? The publisher of this site is based in Japan and replies in Japanese. Contact (Japanese)