When WordPress emails stop arriving, the cause is not always obvious. A contact form may show a success message while the notification never reaches its recipient. WooCommerce order emails may fail silently, while password-reset messages continue to work.
The problem can be anywhere from the notification settings and custom PHP to the server’s mail transport, DNS authentication, or the recipient’s spam filter. This guide takes you through a practical troubleshooting process: test wp_mail(), configure authenticated SMTP, verify SPF and DKIM, and check for plugin or hosting restrictions. If the issue involves custom code or server-level settings, you may also need to hire a WordPress backend developer.
Start by defining what is failing
Before changing your mail settings, identify exactly where the process breaks. Check the following:
- Does the form, checkout, or other feature display an error?
- Does WordPress report success even though no message arrives?
- Do messages fail for every recipient or only one address?
- Are the messages reaching spam, quarantine, or a mail-server rejection log?
- Do emails from one plugin fail while password resets or other WordPress notifications work?
Send test messages to more than one destination, such as a Gmail address and a business mailbox. Check spam and quarantine folders as well as mail logs. A missing message is not necessarily a WordPress sending failure; the message may have been rejected or filtered after WordPress handed it off.
Test whether WordPress can call wp_mail()
WordPress uses wp_mail() as its standard email function. If the function returns true, WordPress has generally handed the message to the configured mail transport. That result does not confirm delivery to the recipient.
For a short diagnostic test, place the following code in a small custom plugin or a site-specific snippets plugin:
<?php
add_action( 'init', function () {
if ( ! current_user_can( 'manage_options' ) || empty( $_GET['email_test'] ) ) {
return;
}
$sent = wp_mail(
get_option( 'admin_email' ),
'WordPress email test',
'This is a temporary wp_mail() diagnostic message.'
);
wp_die( $sent ? 'wp_mail() returned true.' : 'wp_mail() returned false.' );
} );
While logged in as an administrator, visit your site with ?email_test=1 appended to the URL. Remove the diagnostic code as soon as the test is complete. A public test endpoint should not remain on a production site.
If the function returns false, review PHP errors, plugin logs, and your hosting provider’s mail policy. If it returns true but the message does not arrive, move on to authenticated SMTP and domain authentication checks.
Configure SMTP rather than relying on PHP mail
Many hosting companies limit or disable PHP’s default mail transport to prevent abuse. SMTP sends mail through an authenticated provider and normally gives you more reliable delivery and better diagnostic information.
Choose an appropriate SMTP service
Use your business email provider, a transactional email service, or the SMTP relay documented by your host. If the provider supports an API key, application password, or dedicated SMTP credential, use that instead of storing a personal mailbox password in WordPress.
Set up an SMTP plugin
Install a reputable SMTP plugin from the WordPress plugin directory. The interface differs between plugins, but the required settings usually include:
- The SMTP host supplied by your email provider.
- The correct encryption method, such as TLS or SSL.
- The port associated with that encryption method.
- SMTP authentication enabled.
- The mailbox username and a secure credential or application password.
- A “From” address that belongs to the authenticated domain.
Use the plugin’s forced sender setting only when it fits your provider’s requirements. Authenticating as one mailbox while sending from an unrelated address can lead to rejection or poor deliverability.
Send a test message from the plugin’s diagnostic screen and save any error details. A green success notice usually confirms that the message was accepted by the configured transport; it does not prove that the recipient’s inbox accepted it.
Verify SPF, DKIM, and DMARC
SMTP authentication determines how WordPress connects to a mail server. SPF, DKIM, and DMARC help receiving servers decide whether your domain is authorized and whether the message can be trusted.
SPF
SPF is a DNS TXT record that identifies the servers allowed to send mail for your domain. Use the value supplied by your email provider. Your domain should have one consolidated SPF record; multiple SPF records can cause authentication errors.
DKIM
DKIM adds a cryptographic signature to outgoing messages. Your provider will usually give you a selector and the DNS record to publish. After adding the record, allow time for DNS changes to become available, then confirm the signature with your provider’s diagnostic tool or a mail-header analyzer.
DMARC
DMARC tells receiving servers how to handle messages that fail SPF or DKIM alignment. If you are changing an established domain, a monitoring policy can help you identify legitimate sending sources before you enforce stricter handling. Do not combine records from different providers without checking which systems send mail for your domain.
DNS configuration is especially easy to get wrong when your website host and email provider are separate companies. If you are uncertain, ask the email provider or domain registrar to review the records.
Look for plugin conflicts and faulty email code
If the SMTP test succeeds but a contact form or WooCommerce notification does not, investigate that plugin’s configuration and code. Confirm the recipient address, required fields, notification status, and trigger conditions. For WooCommerce, check which order status causes each email to be sent.
On a staging site, temporarily switch to a default theme and disable nonessential plugins. Test after each change so you can identify the component that changes the result. Avoid disabling security or payment-related plugins on a live store unless you understand the risk and have a safe testing plan.
Developers can also inspect custom hooks around wp_mail(), including wp_mail_failed. This temporary logging example can reveal the transport error:
add_action( 'wp_mail_failed', function ( $error ) {
error_log( 'WordPress mail failed: ' . $error->get_error_message() );
} );
Do not log passwords, API keys, payment details, or complete sensitive message contents. Remove temporary debugging code and review any logs after the investigation.
Check hosting, cron, and security restrictions
Contact your host and ask whether outbound SMTP connections are blocked, whether the account has reached a mail quota, or whether an abuse-control rule is restricting delivery. Some hosts require customers to use the host’s own relay rather than an external SMTP service.
Security plugins, firewalls, and managed hosting policies can also block SMTP ports or outgoing requests. If scheduled notifications are missing, investigate WP-Cron as well. A disabled or unreliable cron process can affect scheduled emails, although a direct test message should still help distinguish a cron issue from a broader mail-transport problem.
If the site has recently developed fatal errors or other unusual behavior, review the recovery steps in this WordPress white screen troubleshooting guide. A broken plugin can affect both the visible site and background notifications.
Follow this troubleshooting sequence
- Reproduce the problem and record the exact behavior or error.
- Run a temporary
wp_mail()test. - Configure authenticated SMTP and send a test from the SMTP plugin.
- Confirm the sender address, credentials, encryption, and port.
- Check SPF, DKIM, and DMARC records and alignment.
- Review plugin logs, PHP errors, and
wp_mail_failedoutput. - Ask the host about SMTP blocks, quotas, and outbound mail policies.
- Test for theme and plugin conflicts on staging.
When to hire a WordPress developer
Professional help is worthwhile when the failure involves custom notification workflows, multisite configuration, WooCommerce automation, DNS alignment, server logs, or a conflict that cannot be safely reproduced on production.
A developer can trace the complete path from the triggering action to wp_mail(), the SMTP provider, and the receiving server without relying on risky trial and error. Learn what to look for when hiring a PHP developer or contact me for hands-on WordPress troubleshooting and development support.
Frequently asked questions
Does wp_mail() returning true mean the email was delivered?
No. It generally means WordPress passed the message to its mail transport. The message can still be rejected by the SMTP server, filtered as spam, blocked by DNS authentication failures, or refused by the recipient’s mailbox.
Can an SMTP plugin fix every WordPress email problem?
No. SMTP can resolve unreliable server mail transport, but it will not correct an invalid recipient, a disabled notification, incorrect DNS, or custom code that never calls wp_mail().
Should SPF, DKIM, and DMARC be added to the website host?
They are DNS records for the sending domain. Add the exact records supplied by your email or transactional-mail provider through the DNS manager for that domain.
Why do messages still go to spam after SMTP is configured?
Check sender alignment, SPF, DKIM, DMARC, message content, domain reputation, and the recipient’s filtering rules. SMTP improves the sending connection but cannot guarantee inbox placement.
Conclusion
Diagnose the problem layer by layer. First establish whether WordPress calls wp_mail(), then test authenticated SMTP, verify domain authentication, and inspect plugin, hosting, and DNS logs. This approach is more dependable than changing several settings at once and makes it easier to identify the party responsible for the failure.
