गाइड · वर्डप्रेस

WordPress Email Not Sending: Fix Contact Forms, Resets and Order Emails

Fix WordPress emails that never arrive or land in spam: PHP mail vs SMTP, wp_mail testing, SPF, DKIM and DMARC records, and how to debug delivery step by step.

लेखक: SiteDownCheck संपादकीय टीम · अपडेट: अक्टूबर 5, 2026 · 8 मिनट पढ़ने में

Password reset emails that never come, contact form messages that vanish, WooCommerce order confirmations in the spam folder: WordPress email problems are common because the default setup is weak. Out of the box WordPress sends mail through PHP's mail() function on your web server, with no authentication, from an address like wordpress@example.com. Modern mailbox providers treat unauthenticated mail from a web server with suspicion, and often drop it silently.

The reliable fix is to send through a proper SMTP service or an email API and to publish the DNS records (SPF, DKIM and DMARC) that prove the mail is legitimate. This guide shows how to find where mail is failing and how to fix it.

How WordPress sends email

Every email from WordPress, whether a password reset, a comment notification or a form plugin message, goes through a single function, wp_mail(). It uses the PHPMailer library, which by default hands the message to the server's local mail system via mail() (sendmail or an MTA). If you install an SMTP plugin, it changes PHPMailer to connect to an external mail server with a username and password, or to an API.

So there are three places things can fail:

  1. WordPress or the form plugin never calls wp_mail(), or wp_mail() returns false.
  2. The server cannot hand the message over (no local mail system, outbound port blocked, host restrictions).
  3. The message leaves, but the receiver rejects, defers or filters it, which is the most common case.

Step 1: Test email in isolation

Take form plugins out of the picture and test WordPress's own function.

wp eval 'var_dump( wp_mail( "you@example.net", "WP mail test", "Test body" ) );'

bool(true) means PHPMailer accepted the message for sending, not that it was delivered. bool(false) means WordPress could not hand it off, so the problem is on the server or SMTP side. Without WP-CLI, use the test email feature of any SMTP plugin, or the Site Health check.

To see the real error from PHPMailer, add this temporary snippet as a must-use plugin (wp-content/mu-plugins/mail-debug.php) and look in wp-content/debug.log with debug logging on:

<?php
add_action( 'wp_mail_failed', function ( $error ) {
    error_log( 'wp_mail failed: ' . $error->get_error_message() );
} );

Remove it afterward. Typical errors: Could not instantiate mail function (no usable local mail system), SMTP connect() failed (wrong host, port or blocked port), Could not authenticate (wrong credentials).

Step 2: Check the simple stuff

  • Spam folder of the recipient, and the recipient's address spelled correctly.
  • Admin email. WordPress sends notices to the address in Settings, General. If that mailbox does not exist, you will never see them.
  • From address. If a form plugin uses the visitor's address as the From, mail will fail authentication checks, because your server is not allowed to send for gmail.com or any domain it does not control. Always send from an address at your own domain and put the visitor's address in Reply-To.
  • Plugin settings. Check the form's notification recipient and "From" fields, and that the message is not blocked by a spam filter plugin.
  • Host restrictions. Some hosts disable mail() or limit outgoing messages per hour. Look in the hosting panel or ask support.
  • Mail logs. Install a logging plugin to confirm messages are being generated, or check the server log at /var/log/mail.log or /var/log/maillog if you run your own server.

Step 3: Use SMTP or an email API instead of PHP mail

For anything that matters, send through a service that does deliverability for a living. Options include your own mailbox provider's SMTP (Google Workspace, Microsoft 365, a host-provided mailbox) for low volume, or a transactional email service for higher volume and better tracking. Check your provider's current documentation for limits and setup details, as they change.

A simple approach is a reputable SMTP plugin that lets you enter host, port, encryption and credentials. You can also configure it in code, in a small must-use plugin, keeping the password in wp-config.php constants rather than the database:

// wp-config.php
define( 'SMTP_HOST', 'smtp.example-provider.com' );
define( 'SMTP_USER', 'user@example.com' );
define( 'SMTP_PASS', 'app-password-here' );
// wp-content/mu-plugins/smtp.php
<?php
add_action( 'phpmailer_init', function ( $phpmailer ) {
    $phpmailer->isSMTP();
    $phpmailer->Host       = SMTP_HOST;
    $phpmailer->SMTPAuth   = true;
    $phpmailer->Port       = 587;
    $phpmailer->SMTPSecure = 'tls';   // STARTTLS on 587; use 'ssl' with port 465
    $phpmailer->Username   = SMTP_USER;
    $phpmailer->Password   = SMTP_PASS;
    $phpmailer->From       = 'no-reply@example.com';
    $phpmailer->FromName   = 'Example Site';
} );

Port notes: 587 with STARTTLS is the standard submission port, and 465 is implicit TLS. Port 25 is commonly blocked outbound by hosts and cloud providers to reduce spam, so avoid it. Check that the connection works from your server before blaming WordPress:

nc -vz smtp.example-provider.com 587
openssl s_client -starttls smtp -connect smtp.example-provider.com:587

Use an app-specific password or API key where the provider supports it, not your main account password. If an API integration is available, it avoids SMTP port blocks entirely, since it uses HTTPS.

Step 4: Fix DNS authentication: SPF, DKIM and DMARC

Receiving servers check three DNS-based signals about your domain. Missing or wrong records are the top reason for mail to land in spam or be rejected outright. The SPF, DKIM and DMARC complete guide explains them in depth; here is what to set up for WordPress.

SPF

SPF lists which servers may send for your domain. It is a TXT record at the domain apex, and there must be only one SPF record. If you send via a provider, include their mechanism (use the exact value from their documentation):

example.com.  TXT  "v=spf1 include:_spf.google.com include:sendprovider.example ~all"

Common problems are two separate SPF records (invalid), more than 10 DNS lookups (permerror; see fix SPF too many DNS lookups), and forgetting to add the service that actually sends the WordPress mail. Verify with the SPF रिकॉर्ड चेकर, and build a record with the SPF and DMARC Generator.

DKIM

DKIM adds a cryptographic signature to each message, verified against a public key in DNS. Your sending service gives you a selector and a record, usually a CNAME or TXT such as selector1._domainkey.example.com. Add it exactly as given, then press "verify" in the provider's dashboard. See DKIM setup and troubleshooting. A message signed by a provider with your own domain in the d= value aligns with DMARC; signing only with the provider's domain does not.

DMARC

DMARC tells receivers what to do when SPF and DKIM do not align with the visible From domain, and where to send reports. Start in monitoring mode:

_dmarc.example.com.  TXT  "v=DMARC1; p=none; rua=mailto:dmarc-reports@example.com"

Review the reports, fix any legitimate sources that fail, and then move to quarantine and reject, as described in DMARC rollout: none, quarantine, reject. Large mailbox providers now require authentication for bulk senders, so having all three in place also matters for volume mail.

Check everything at once with the Email DNS Checker, and confirm the domain can receive mail at all with the MX लुकअप. After you edit DNS, remember records take time to appear everywhere; see how long DNS propagation takes, and inspect what resolvers see with the DNS चेकर.

Step 5: Test the actual result

Send a real WordPress email to the ईमेल डिलीवरेबिलिटी टेस्ट address and review the report, then confirm in a Gmail inbox: open the message, choose "Show original", and look for SPF: PASS, DKIM: PASS and DMARC: PASS. Headers tell the truth. A failure shows which check broke:

  • SPF fail or softfail: the sending server is not in your SPF record, or you have the wrong envelope sender.
  • DKIM none or fail: the signature is missing, or the selector's DNS record is wrong.
  • DMARC fail: neither SPF nor DKIM aligns with the From domain.

Step 6: Reputation and blocklists

If authentication passes but mail still goes to spam or is rejected, check sender reputation.

If the site was compromised, spam sent from it can destroy your reputation, so see WordPress site hacked recovery.

For WooCommerce, see transactional email DNS checklist और e-commerce order email deliverability.

Monitor so you find out first

A site that quietly stops sending orders is costly. Use an uptime monitor with a heartbeat or cron monitoring for queue-based mail systems, and watch the DMARC reports for unexpected sources or failures.

अगले कदम

सामान्य प्रश्न

Why does wp_mail return true but no email arrives?

True only means PHPMailer handed the message to the mail system. Delivery can still fail later because the receiver rejected it. Check headers, bounce messages and the SPF, DKIM and DMARC results.

Do I need an SMTP plugin?

For anything important, yes, or an equivalent code snippet or API plugin. Mail sent through PHP mail() from a web server often lacks authentication and a good IP reputation, which leads to spam placement or rejection.

Can I use my Gmail or Outlook account for SMTP?

Often yes for low volume, with an app password and the provider's SMTP settings, but sending limits apply and policies change. Check the provider's current documentation, and consider a transactional service as volume grows.

Why do emails work when I send to myself but not to customers?

Your own mailbox may be on the same provider or whitelist your server, while stricter receivers apply full authentication checks. Test with an external inbox and read the authentication results in the headers.

Should I set DMARC to reject straight away?

No. Start with p=none and review reports to find all legitimate senders, fix their alignment, then tighten the policy in stages.

Get notified when this guide updates

Plus occasional practical tips on uptime and monitoring, nothing else. Unsubscribe anytime.

यह पेज सामान्य जानकारी है, जिसे हमारी संपादकीय टीम ने लिखा है और दस्तावेज़ीकरण बदलने पर अपडेट किया जाता है। सर्वर और प्रदाता अलग-अलग होते हैं, इसलिए बदलाव पहले सुरक्षित तरीके से जाँचें। देखें: संपादकीय नीति और अस्वीकरण.