When WordPress is not sending email, the error message can point to the stage that failed. A failed wp_mail() call does not itself show an error to the site visitor or write it to a log; a plugin, hook listener or application code must expose it. So this page starts with capturing that message, then follows it to the page that explains it. If there is no message, or WordPress reports success and the email still never arrives, steps 3 and 4 cover those cases.
Where an email can stop
A WordPress email passes through four stages on its way out, and it can fail at any of them:
- The sending plugin. A mailer plugin can route WordPress email through a configured sending service. Wrong credentials, a wrong host name or a blocked port stop the message here, and this is where WordPress usually records an error.
- The transport. With no mailer plugin, WordPress hands the message to PHP’s
mail()function and the server’s local mail program. The host can refuse it outright, or accept it and then drop it without saying so. - The relay. An external sending service accepts the message and tries to deliver it. It can reject it for its own reasons (a suspended account, a sending quota, an unverified domain) after WordPress has already reported success.
- The receiver. Gmail, Outlook or a company’s mail server decides whether to accept the message, bounce it or file it as spam, largely on the SPF (Sender Policy Framework) is a DNS TXT record that lists the servers allowed to send mail using your domain. Receivers compare the sending IP to that list and use the result as one input to their accept/reject decision. Read full reference →, DKIM (DomainKeys Identified Mail) is a cryptographic signature attached to each outgoing message, verifiable against a public key published in DNS. It lets receivers confirm the message was not altered in transit and originated from a server the domain authorised to sign on its behalf. Read full reference → and DMARC (Domain-based Message Authentication, Reporting, and Conformance) is a DNS TXT record that tells receivers what to do with mail from your domain that fails SPF or DKIM, and where to send reports about those failures. Read full reference → records of the sending domain.
The symptom alone rarely says which stage failed. A missing password reset email looks the same whether the host blocked the port or Gmail filed it as spam. The error message, or its absence, is what separates them.
Step 1: Run a check and capture the error
With a plugin
nanoPost Email Check is a free plugin, made by nanoPost, that sends a test email and records the result. Install it, open Tools > Email Check, enter a mailbox you can read, and press Send test now. The result appears under Recent results, with any error text WordPress reported.
Without a plugin
On a site where you cannot install plugins, three lines in a must-use plugin or the active theme’s functions.php capture the same message. In WordPress’s standard wp_mail() path, a PHPMailer exception fires the wp_mail_failed action and passes the error to it. A plugin or filter can return failure without raising that action:
add_action( 'wp_mail_failed', function ( $error ) {
error_log( 'wp_mail failed: ' . print_r( $error->errors, true ) );
} );
With WP_DEBUG_LOG enabled in wp-config.php, the message lands in wp-content/debug.log. Trigger a send (the “Lost your password?” link on the login screen works on any site), then read the log. The wp_mail_failed hook guide explains which errors reach this hook and which do not.
Read the result
There are three outcomes, and each one has its own step below:
- The send failed and there is an error message. Go to step 2.
- The send failed and there is no error message. Go to step 3.
- The send succeeded, but the email did not arrive. Go to step 4. A success here means WordPress handed the message on. It does not mean the message reached an inbox.
Step 2: The send failed with an error message
The message is the one PHPMailer, the library WordPress sends with, raised at the point it gave up. The start of it is enough to identify the stage that failed. Find the opening words in the table, or paste the whole line into the error decoder, which explains the messages it recognises in your browser.
| The error starts with | What failed | Where to go next |
|---|---|---|
Could not instantiate mail function. |
Stage 2. PHP’s hand-off to the server’s mail program failed: the program named in sendmail_path is missing, or it ran and reported failure. A host switching mail() off is a different failure on PHP 8: the send stops with a fatal error and wp_mail_failed never fires. |
Could not instantiate mail function |
SMTP Error: Could not connect to SMTP host. or SMTP connect() failed. (the latter may be shown by PHPMailer integrations, usually with its troubleshooting URL) |
Stage 1. The connection to the mail server did not complete: a wrong host name or port, an encryption setting that does not match the port, or a host that blocks outbound mail ports. | Could not connect to SMTP host: the line in the debug log that names each cause, and the fix for each. The port test below checks one port from the server. |
SMTP Error: Could not authenticate. |
Stage 1. The server refused authentication. In WordPress’s standard path, the error recorded by wp_mail_failed is this generic line; a mailer plugin may expose the server’s reply in its debug log if that logging is enabled. Examples include Gmail’s 535 5.7.80 (“Username and Password not accepted”) and Microsoft 365’s 535 5.7.3 (“Authentication unsuccessful”). |
Could not authenticate and 535 5.7.8, Gmail included. Microsoft 365: the SMTP AUTH section of the Microsoft 365 guide |
Extension missing: openssl |
Stage 1. The mailer is set to encrypt the connection, and PHP on this server has no OpenSSL extension. | Ask the host to enable PHP’s openssl extension, or read the TLS entries in the field manual |
SMTP Error: data not accepted. |
Stage 1. The server accepted the sender and the recipients, then refused the message itself. The error line does not say why. When SMTP debugging is enabled and its output is retained, the transcript shows the server’s reply. | SMTP Error: Data not accepted: how to get the server’s reason and what each one means |
SMTP Error: The following recipients failed: |
Stage 1. The server refused one or more recipient addresses. The reply code after the address says why (550 5.1.1 means the mailbox does not exist). |
The SMTP field manual |
Invalid address: |
Before sending. PHPMailer rejected the From address WordPress supplied. Core defaults it to wordpress@ plus the site’s host name. If that address fails validation (for example, on some local host names such as localhost), set a valid From address in the mailer plugin or with the wp_mail_from filter. |
Invalid address: (From): each cause and how to tell which one you have |
You must provide at least one recipient email address. |
Before sending. Every recipient was dropped. wp_mail() silently discards any address it cannot parse, so one typo in the only recipient leaves none. |
Correct the recipient address in the form or setting that sends the message |
A 4xx reply, such as 421 4.7.0 |
Stage 1 or 3. A temporary refusal, often a rate limit. The server expects the sender to try again later. | The SMTP field manual |
A message that is not in the table usually still names its stage. Text about connecting, sockets or timeouts is stage 1 before the login; text about passwords or authentication is the login; a reply that quotes a policy or a domain record comes from the server after the login.
When WordPress cannot connect
A hosting provider may block outbound connections on ports 25, 465 or 587. Check its published mail policy before treating a timeout as a port block. The settings and credentials can be correct and the send still times out. If you have SSH access, test the port from the server itself:
openssl s_client -connect smtp.postmarkapp.com:587 -starttls smtp
Replace the host name with your sending service’s. A completed handshake shows that the port is open. A failed handshake means the connection did not complete; it does not by itself show whether the port is blocked or the server closed the connection for another reason.
If the provider confirms that it blocks the port, no SMTP setting will fix that route. If both your sending service and mailer plugin support an HTTP API, you can use that instead; otherwise ask the host whether it can allow the connection.
Step 3: The send failed with no error message
A failure with no text means wp_mail() returned false without passing an error through wp_mail_failed. That points at code rather than at a mail server: a filter that stops sending early, a plugin that replaces wp_mail(), or a mailer that reports failure without raising an error. A test failed without an error message walks through finding which one, starting with the sending plugin’s own log.
A related case produces no record at all. Some older contact-form and payment plugins call PHP’s mail() directly, so their messages never pass through wp_mail() or the mailer plugin. If one type of email arrives and another never shows up in any log, look for a plugin that sends on its own. Check that WordPress can send emails covers testing each path separately.
Step 4: WordPress reported success, but the email never arrived
wp_mail() returns true when the message has been handed on, not when it has been delivered. Everything after that happens at stage 2, 3 or 4, out of WordPress’s sight.
No mailer plugin, so the server sent it. Without a mailer plugin, WordPress uses PHP mail() and the server’s mail setup. That setup determines which server sends the message and whether it is signed; check the message headers and your host’s published sending limits. A mailer plugin configured for a sending service routes the message through that service. After you publish the provider’s required DNS records, check the message headers to confirm that SPF or DKIM passes and aligns with the visible From domain.
On cPanel hosting, a message to an address at the site’s own domain may be delivered locally if cPanel routes that domain as a Local Mail Exchanger. cPanel says that this setting makes the server accept mail for the domain and deliver it to a local mailbox. Applying that rule to a message sent by WordPress through PHP mail() is an inference, so check the domain’s routing before treating it as the cause. The answer on own-domain mail and “550 No Such User Here” shows how.
A sending service sent it. Open the service’s activity log and look for a delivery or bounce event for the message. Event names vary by service. If the service records a bounce, its event details may include the receiver’s reason. A message that WordPress reported as sent but that is missing from the service’s log may never have reached the service, so check the credentials and endpoint first.
The receiver filtered or refused it. Authentication is one factor the receiver may use. DMARC checks that the domain in the visible From address matches a domain that passed SPF or DKIM. A site sending as [email protected] through a host whose mail server identifies itself as [email protected] can pass SPF for the host’s domain and still fail DMARC, because the two domains do not match. Signing with the site’s own DKIM key, through a sending service, fixes the match. Set up DNS for WordPress email walks through publishing the records, and the DMARC reference explains alignment and policy in full. For spam placement with authentication already passing, why WordPress emails are not being delivered covers the receiver’s side.
Step 5: Check that it stays fixed
After the change, send another test and check two things: the result WordPress reports, and the receiving mailbox, including the spam folder. A pass with no email in the mailbox sends you back to step 4.
A fix that works today can stop working without anyone touching the site: a password is changed, an app password is revoked, a host changes its mail policy, or a plugin update changes the From address. Nobody notices until a customer asks where their order confirmation went. Two ways to find out sooner:
- Email Check. nanoPost makes this plugin. It repeats the test daily, twice daily or weekly and shows a dashboard warning when a test fails. It can also send a JSON webhook alert to Slack, Google Chat or a service that accepts the plugin’s webhook payload, so the alert does not depend on email working.
- Keep the
wp_mail_failedlogging from step 1. Left in place, it records every failed send on the site, not only a test message, inwp-content/debug.log. It warns no one, so it is only as good as how often someone reads the log.
Corrections
- 2026-11-19: an earlier version said this error appears when a host switches PHP’s
mail()off. On PHP 8, a switched-offmail()stops the send with a fatal error, and this error does not appear. This error comes from a mail program that is missing or that reports failure.

