Skip to content

How to Fix WordPress Not Sending Email Issue

How to Fix WordPress Not Sending Email Issue

When transactional and notification emails stop reaching users, it creates support overhead and damages trust. This guide walks through practical, developer-friendly steps to diagnose and resolve common causes of WordPress email failures, improve deliverability, and set up reliable SMTP or transactional services so your site’s emails consistently land in inboxes.

Quick troubleshooting checklist

  • Confirm the issue: Are emails failing to send, or are they being delivered to spam?
  • Test WordPress’s built-in mail function using a simple wp_mail() test.
  • Check hosting policies: many hosts block PHP mail() or port 25.
  • Verify the From address and domain DNS (SPF/DKIM/DMARC).
  • Enable mail logging to capture errors and SMTP responses.

Diagnose: understand the failure mode

Start by classifying the problem. Knowing whether WordPress is handing mail off to the server but messages are dropped, or WordPress can’t hand off email at all, determines the fixes you’ll apply.

Common failure modes

  • No emails are sent at all (forms, new user notifications, password resets).
  • Emails are sent from the server but arrive in spam folders.
  • Only specific emails (e.g., WooCommerce receipts) fail.
  • Intermittent delivery — sometimes delivered, sometimes not.

Step-by-step fixes

1. Run a simple wp_mail() test

Place this snippet in a temporary plugin file or in functions.php (remove after testing). It verifies whether WordPress can use PHP mail() to send a message.

<?php
add_action('init', function() {
    if (!isset($_GET['mail_test'])) return;
    wp_mail('you@example.com', 'Test mail', 'This is a test from WordPress.');
    exit('mail attempted');
});
?>

Visit yoursite.com/?mail_test=1 to trigger. If you receive the email, WordPress can send via the server; focus on deliverability. If not, the server or PHP mail() is the issue.

2. Check error logs and enable mail logging

  • Use a plugin like WP Mail Logging, Email Log, or the logging built into SMTP plugins (WP Mail SMTP, Post SMTP) to capture send attempts and SMTP responses.
  • Inspect PHP and server logs for errors about mail or outbound connections.

3. Verify From address and headers

Use an email address that belongs to your domain (no free providers like Gmail as the From address) — e.g., notifications@yourdomain.com. Mismatched From addresses often trigger spam filters or are rejected by receiving servers.

4. Move away from PHP mail(): use SMTP or a transactional API

PHP mail() is unreliable on many hosts and lacks authentication. Configure WordPress to send via an authenticated SMTP provider or use an API-based transactional email service for best deliverability.

  • Popular SMTP plugins: WP Mail SMTP, Post SMTP Mailer/Email Log, FluentSMTP.
  • Transactional services: SendGrid, Mailgun, Amazon SES, SparkPost, Postmark.

Example SMTP plugin configuration (general):

  • Mailer: SMTP or service API
  • SMTP Host: smtp.example.com (or service-specific host)
  • Port: 587 (TLS) or 465 (SSL), or 25 if permitted
  • Encryption: TLS
  • Authentication: username and password or API key
  • From Email: notifications@yourdomain.com

5. Configure DNS: SPF, DKIM, and DMARC

DNS records tell receiving mail servers that your site is authorized to send mail for your domain.

  • SPF: Add an SPF TXT record that authorizes your server and transactional providers. Example: v=spf1 include:spf.sendgrid.net include:mailgun.org -all
  • DKIM: Enable DKIM signing in your mail provider and add the provider’s DKIM TXT record in DNS.
  • DMARC: Add a DMARC policy to set reporting and enforcement. Start with p=none while testing, then move to p=quarantine or p=reject as you gain confidence.

6. Use a transactional API when available

APIs (SendGrid, Mailgun, SES) deliver better performance and reliability than SMTP in many environments. Many WordPress SMTP plugins support API keys for these services, reducing connection issues and improving deliverability.

7. Check hosting and outbound connection restrictions

Shared hosts often block outbound SMTP ports to prevent abuse. If you suspect blocking:

  • Contact your host to confirm whether they block ports 25, 465, or 587 or disallow external SMTP.
  • Use the provider’s API or an SMTP relay allowed by the host (some hosts provide their own mail relay).

8. Test with mail-tester and mailbox providers

Send messages to a test address at mail-tester.com to get a deliverability score and actionable advice (SPF/DKIM failures, content issues). Also test to major providers (Gmail, Outlook) and check the headers to see why a message went to spam.

9. Resolve plugin or theme conflicts

Sometimes a plugin or theme hook interferes with wp_mail(). To isolate:

  • Temporarily switch to a default theme (e.g., Twenty Twenty-One) and test.
  • Disable nonessential plugins one by one and test sending.
  • Check plugins that modify emails (SMTP plugins, form plugins, WooCommerce) for conflicting settings.

10. Address WooCommerce, Gravity Forms, Contact Form 7, and other integrations

These plugins generate most transactional emails. Ensure they use the WordPress mail system (or your SMTP plugin) and that their From address matches your authorized domain. For WooCommerce, confirm email templates and that the SMTP plugin is active and configured site-wide.

11. Use queues for large volumes

If your site sends many emails (newsletters, transactional bursts), use a queuing mechanism to avoid timeouts and rate limits. Plugins like WP Offload SES or third-party systems can queue and throttle mail to match provider limits.

Troubleshooting scenarios and targeted fixes

Scenario: Emails send but land in spam

  • Ensure SPF and DKIM are set and pass for the sending domain.
  • Use a consistent, reputable From address on your domain.
  • Check message content for spam triggers (excessive links, images, misleading subject lines).
  • Ask recipients to whitelist your email or encourage Gmail recipients to mark as “Not spam” to train filters.

Scenario: No emails are being sent

  • Verify wp_mail() test. If it fails, check PHP configuration and mail() function availability.
  • Enable SMTP with authentication or switch to an API-based provider.
  • Confirm cron jobs or background tasks that trigger emails are running (see WP-Cron).

Scenario: Only some emails fail (password resets work, form notifications do not)

  • Check specific plugin settings for email hooks and sender overrides.
  • Enable logging for the plugin that generates the failing emails to capture errors.
  • Look for conditional logic in code that may prevent sending under certain conditions.

Monitoring and long-term reliability

  • Keep mail logs and periodically review bounce and complaint reports from your provider.
  • Set up alerting or use provider dashboards to monitor delivery rates and reputation.
  • Rotate or validate sender addresses, and maintain clean lists to reduce bounces.
  • Periodically re-check SPF/DKIM/DMARC after DNS or provider changes.

Best-practice checklist before going live

  • Choose a transactional provider or SMTP relay that matches volume and budget.
  • Use a dedicated sending domain or subdomain (e.g., mail.yourdomain.com) for better reputation control.
  • Implement SPF and DKIM, and publish a DMARC policy.
  • Use TLS encryption for SMTP or API connections.
  • Test deliverability across major providers and iterate on feedback.
  • Enable logging and retention for troubleshooting.

Conclusion

Fixing email delivery in WordPress requires a methodical approach: determine whether the problem is sending or deliverability, replace PHP mail() with authenticated SMTP or an API-based transactional provider, configure SPF/DKIM/DMARC, and enable logging to capture errors. With proper DNS setup, an authenticated sending method, and ongoing monitoring, your WordPress site will reliably deliver notifications and transactional messages to users’ inboxes.

Michał Mikołaszek

Michał Mikołaszek

I’ve been leading Grafiduo since 2010 as the CEO. Together with my development team, I create e-commerce solutions, websites, and digital designs that combine functionality with aesthetics. I focus mainly on WordPress, WooCommerce, and Prestashop, helping businesses grow through well-crafted online experiences.

Need a high-performing website?

Get a quote