How to Fix WordPress Not Sending Emails with SMTP
Sarah stared at her inbox. The contact form submission from a potential client had never arrived, and the inquiry was gone — lost somewhere between her WordPress site and the ether. She checked the spam folder, ran a test, and watched the confirmation message say "sent" while her personal email stayed silent.
This scenario plays out on thousands of WordPress sites every day. WordPress not sending emails is rarely a hosting outage or a plugin conflict in the way most people imagine. In the vast majority of cases, it is a simple configuration problem: your server's default PHP mail() function is either blocked by the host, flagged as spam by the recipient's mail server, or has no proper authentication. The quickest fix is to install an SMTP plugin and configure it with a valid mail service provider. This article walks you through every fix — from the 30-second plugin toggle to advanced server-side patches — ordered by likelihood and ease.
Before you start: Back up your WordPress files and database. Take a full snapshot if your hosting panel offers one. Keep a database export handy in phpMyAdmin. A handful of these fixes involve editing wp-config.php or .htaccess, and a single typo can break your site.
Common Causes of WordPress Email Delivery Failure
- Your web host blocks or throttles port 25, 465, or 587.
- The default PHP
mail()function is disabled for security reasons. - Recipient mail servers (Gmail, Outlook, Yahoo) reject unauthenticated mail as spam.
- Your site's
From:email address uses a domain that does not match the sending server. - An email plugin (WP Mail SMTP, Easy WP SMTP, Post SMTP) is misconfigured with wrong credentials.
- Another plugin or theme is overriding the
wpmail()function and breaking it. - Your SPF, DKIM, or DMARC DNS records are missing or incorrect.
- The email is being caught by your hosting provider's outgoing mail queue or rate limit.
How Do I Test If WordPress Can Send Emails?
Before you apply any fix, confirm the problem exists. Do not trust the confirmation message in your contact form plugin — that only proves the form submitted data to the database, not that the email left the server.
Install a lightweight testing plugin like WP Mail Logging or Check & Log Email. These tools intercept every wpmail() call and let you see the headers, recipient, and result. Alternatively, use a free online tool like Mail Tester by sending a test email to a unique address they provide; it will score your deliverability and highlight spam issues.
If you prefer not to install a plugin, create a simple PHP test file. Upload a file named testmail.php to your site root with the following content, then visit it in your browser:
<?php
$to = '[email protected]';
$subject = 'Test from WordPress';
$message = 'This is a test email.';
$headers = array('Content-Type: text/html; charset=UTF-8');
if (wp_mail($to, $subject, $message, $headers)) {
echo 'wp_mail returned true';
} else {
echo 'wp_mail returned false';
?>Delete the file immediately after testing. If wpmail() returns true but you do not receive the email, the problem is deliverability, not a broken function.
5 Quick Fixes to Try First
Fix 1: Activate a Reliable SMTP Plugin
The single most effective change you can make is to bypass the PHP mail() function entirely and route your WordPress emails through a proper SMTP (Simple Mail Transfer Protocol) server that requires authentication.
Install a plugin such as WP Mail SMTP or Post SMTP Mailer/Email Log. Navigate to Settings → WP Mail SMTP (or the equivalent menu for your chosen plugin). Select your mailer: popular choices include SMTP.com, SendLayer, Amazon SES, Mailgun, SendGrid, or Gmail SMTP via OAuth.
Enter the SMTP host, port, encryption type (SSL or TLS), and authentication credentials supplied by your email service. Most shared hosting SMTP servers use mail.yourdomain.com on port 465 with SSL. Send a test email from the plugin's test interface. If it arrives, your problem is solved.
Fix 2: Check and Correct the From Email and From Name
Many WordPress emails are rejected because the From: address uses a domain that the recipient server does not trust. WordPress defaults to [email protected], but your hosting server may be configured to send only from an address hosted on that exact server.
In your SMTP plugin settings, set the From Email to an address that exists on your domain (e.g., [email protected]). If you use a transactional email service like SendGrid or Mailgun, use the verified sender address they provide. Ensure the From Name matches your brand so recipients recognize the sender.
Fix 3: Verify SMTP Port and Encryption Settings
Your web host may block certain ports. The standard SMTP ports are:
- 25 — Often blocked by ISPs and shared hosts due to abuse.
- 465 — SMTP over SSL. Reliable and widely supported.
- 587 — SMTP with STARTTLS. The modern standard.
- 2525 — An alternate port sometimes open when 25 is blocked.
Test each port in your SMTP plugin. If port 587 fails, try 465. If both fail, contact your host and ask which SMTP ports they allow.
Fix 4: Deactivate Conflicting Plugins Temporarily
Another plugin — especially security plugins, caching plugins, or other email plugins — can override wpmail() and insert broken headers or premature exits.
Deactivate all plugins except your SMTP plugin. Send a test email. If it works, reactivate your plugins one by one, testing after each activation, until the break reappears. That plugin is the culprit. Contact the plugin developer for a fix or find an alternative.
Fix 5: Switch to a Default Theme for a Moment
A poorly coded theme can also hook into wpmail() and alter the email headers. Temporarily switch to a default WordPress theme like Twenty Twenty-Four. Test email delivery. If it works, your theme is interfering. Contact the theme author or consider switching themes permanently.
4 Advanced SMTP and Server-Level Fixes
Fix 6: Configure SMTP Directly in wp-config.php
If you do not want to rely on a plugin, you can hardcode SMTP settings into your wp-config.php file. Open the file in a text editor and add the following snippet before the line that says / That's all, stop editing! /:
define('SMTPHOST', 'smtp.yourmailservice.com');
define('SMTP_PORT', 465);
define('SMTP_AUTH', true);
define('SMTP_SECURE', 'ssl');
define('SMTP_USERNAME', '[email protected]');
define('SMTP_PASSWORD', 'your-email-password');
define('SMTP_FROM', '[email protected]');
define('SMTPFROMNAME', 'Your Site Name');Replace the placeholder values with your actual SMTP server credentials. Save the file and upload it back to your server. This method is plugin-independent and does not add overhead to your admin panel.
Fix 7: Add or Correct SPF, DKIM, and DMARC DNS Records
Email authentication records tell receiving mail servers that your domain is authorized to send mail. Without them, your emails look like spoofed messages.
Log into your domain registrar or DNS hosting provider. Locate the DNS management section. Add an SPF record that includes your sending server. For example, if you use a shared host, the record might look like: v=spf1 +a +mx include:yourhost.com ~all. If you use SendGrid or Mailgun, use their provided SPF value.
DKIM adds a digital signature. Your SMTP provider will give you a DKIM key to add as a TXT record. DMARC tells receivers how to handle unauthenticated mail. A basic DMARC record is: v=DMARC1; p=quarantine; rua=mailto:[email protected].
DNS changes can take up to 48 hours to propagate. Test again after 24 hours.
Fix 8: Enable or Adjust PHP Mail Function with Your Host
Some shared hosting providers disable the PHP mail() function to prevent spam. Others restrict it to a specific rate (e.g., 100 emails per hour).
Contact your host's support team. Ask: "Is the PHP mail() function enabled? Is there an outgoing email rate limit? Can you whitelist my domain?" If they confirm it is disabled, you must use an SMTP plugin or a third-party transactional email service. If rate limiting is the problem, batch your notifications or use a dedicated email API.
Fix 9: Check for Cron or Queue Issues
WordPress uses the built-in wp-cron.php to send scheduled emails, such as password resets, new user registrations, and post update notifications. If your site's cron system is broken — often because of a caching plugin, a server-level cron misconfiguration, or a low DISABLEWPCRON constant — those emails queue up and never send.
Install a plugin like WP Crontrol to inspect your cron jobs. Look for the wpmail hook. If a cron job is stuck or missing, the plugin can run it manually. Alternatively, check your server's system cron if your host uses it instead of WP-Cron. A misaligned server cron will never trigger WordPress email tasks.
How to Prevent WordPress Email Issues in the Future
Once your emails are flowing, lock down your setup so the problem does not return after the next update.
Keep your SMTP plugin updated. Plugin authors regularly patch compatibility with new WordPress releases and changes in mail server requirements. Stick with a plugin that has a solid update history and active support forums.
Monitor your email log weekly. A quick glance at the log tells you if a sudden spike in failures happened. That early warning can catch a expired API key, a revoked OAuth token, or a changed SMTP password before your visitors notice.
Set calendar reminders to renew any transactional email service subscriptions. Forgetting to renew Mailgun or SendGrid is one of the most common reasons a site that worked perfectly for months suddenly stops sending.
Frequently Asked Questions
Why does WordPress say email sent but I never receive it?
WordPress's wpmail() function can return true (success) even when the email is rejected at the receiving end. The function only confirms that the mail was handed off to the server's outgoing mail system. If the server rejects it due to spam policies, authentication failures, or rate limits, wpmail() still reports success. That is why relying on the return value alone is deceptive — always check email logs and delivery reports.
Do I need a dedicated SMTP service or can I use Gmail?
You can use Gmail SMTP for low-volume sites. Gmail allows up to 500 recipients per day through SMTP. However, Google may revoke access if it detects automated or bulk behavior. For commercial websites sending contact form submissions, order confirmations, or membership emails, a dedicated transactional email service like SendGrid or Amazon SES is more reliable and does not depend on your personal Gmail account's security settings.
Can a WordPress plugin conflict prevent email delivery?
Yes. Plugins that hook into phpmailerinit or wpmail can alter headers, attachments, or the recipient list. Security plugins sometimes modify outgoing email to mask the sender. Caching plugins can interfere with the cron jobs that trigger scheduled emails. The fastest diagnostic is a full plugin deactivation test.
What do I do if SMTP port 465 is blocked by my host?
Contact your hosting provider and ask which SMTP ports they allow through their firewall. Most hosts unblock port 587 (STARTTLS) if 465 is blocked. As a fallback, some providers open port 2525. If your host blocks all outbound SMTP, you must use a third-party transactional email API (SendGrid, Mailgun, Amazon SES) that sends over HTTP instead of raw SMTP.
How do I fix WordPress not sending emails after moving to a new host?
Your SMTP credentials from the old host are invalid on the new server. Update your SMTP plugin with the new host's mail server details. Also update your SPF and DKIM DNS records if your sending IP address changed. Finally, verify that your domain's MX records point to the correct mail server.
Wrapping It Up
A WordPress site that cannot send email is like a store with a disconnected phone line. Visitors try to reach you, but their messages vanish into a void. The fixes in this guide — from installing an SMTP plugin to adjusting DNS records — cover the full range of root causes so you can be confident no email will be lost.
Once your site is running smoothly and reliably delivering every inquiry, you can focus on growth. Tools like nativeWP help you publish SEO-optimized content on autopilot, so your restored contact form stays busy with new leads.