How to Fix SMTP Email Sending Issues in WordPress (Full Guide)
Why WordPress Emails Fail?
Out of the box, WordPress relies on the PHP mail() function to send emails such as password reset links, contact form submissions, and order notifications.

However, in many hosting environments, this function is unreliable, blocked, or poorly authenticated, which leads to emails:
- Not being delivered
- Being marked as spam
- Or getting silently dropped by receiving servers
This is a critical issue—especially for eCommerce, membership, and lead generation sites—where email delivery is essential.
What Is SMTP and Why It Solves the Problem?
SMTP stands for Simple Mail Transfer Protocol. It’s the standard protocol used to send emails via authenticated and secured servers.
Using SMTP ensures:
- Emails are sent through a real email server (not just from your web server)
- Authentication (username/password) is used
- Messages pass through anti-spam filters more reliably
- SPF, DKIM, and DMARC validations are respected
PHP Mail vs SMTP
Feature | PHP Mail | SMTP |
---|---|---|
Authentication | ❌ No | ✅ Yes |
Deliverability | ❌ Poor | ✅ High |
Encryption | ❌ Not secure | ✅ SSL/TLS |
Compatibility | ✅ Basic | ✅ Universal |
Best For | Testing only | Production email sending |
Step 1: Install a WordPress SMTP Plugin
To fix this issue, you need to route WordPress emails through SMTP using a plugin.
Top SMTP Plugins for WordPress:
- WP Mail SMTP (by WPForms) – Most popular, easy setup, supports multiple SMTP providers
- Post SMTP – Has advanced debugging and fallback options
- FluentSMTP – Fast, lightweight, and privacy-focused
We’ll use WP Mail SMTP in this tutorial.
Installation Steps:
- Go to Plugins > Add New
- Search for: WP Mail SMTP
- Click Install and then Activate
Step 2: Choose an SMTP Email Provider
You need to use a real email service that provides SMTP credentials.
Provider | SMTP Host | Port | Encryption | Notes |
---|---|---|---|---|
Gmail / GSuite | smtp.gmail.com | 587 | TLS | Requires App Password |
Outlook / Office365 | smtp.office365.com | 587 | TLS | Use business account |
Mailgun | smtp.mailgun.org | 587 | TLS | Great for developers |
SendGrid | smtp.sendgrid.net | 587 | TLS | Easy to set up |
Zoho Mail | smtp.zoho.com | 465 | SSL | Requires domain verification |
For serious websites, we recommend domain-based providers like SendGrid, Mailgun, or SMTP2GO.
Step 3: Configure SMTP Plugin Settings
After installing WP Mail SMTP:
1. Go to WP Mail SMTP > Settings
2. Under Mailer, choose:
- “Other SMTP” if using custom provider (e.g., Mailgun, SendGrid)
- “Gmail” if using Gmail (requires OAuth or App Password)
3. Fill in the SMTP details:
Setting | Example |
---|---|
From Email | no-reply@yourdomain.com |
From Name | Your Website Name |
SMTP Host | smtp.sendgrid.net |
Encryption | TLS or SSL |
SMTP Port | 587 (TLS) or 465 (SSL) |
Authentication | Yes |
Username | your full email |
Password | App password or SMTP token |
Step 4: Send a Test Email
To confirm everything works:
- Go to WP Mail SMTP > Tools > Email Test
- Enter an email address (preferably Gmail or your own)
- Click Send Email
If successful, you’ll see:
“The test email has been sent successfully!”
If failed, error logs will guide you (e.g., connection refused, authentication failed).
Step 5: Ensure DNS Records Are Correct (SPF, DKIM, DMARC)
To ensure email deliverability, configure DNS records for your domain:
- SPF: Tells email servers which IPs can send on behalf of your domain
- DKIM: Authenticates that emails haven’t been tampered with
- DMARC: Policy framework to block fake emails
Example DNS records for Mailgun:
SPF: v=spf1 include:mailgun.org ~all
DKIM: k=rsa; p=MIGfMA0GCSq...
DMARC: v=DMARC1; p=none; rua=mailto:admin@yourdomain.com
Code language: HTTP (http)
Contact your domain registrar or use Cloudflare to add these records.
Step 6: Common SMTP Errors and Fixes
Error | Cause | Fix |
---|---|---|
SMTP connect() failed | Wrong port, encryption, or blocked server | Check port (587 or 465), try TLS/SSL |
Authentication failed | Wrong password or app password missing | Use correct SMTP password or token |
Could not connect to SMTP host | Firewall or port blocked | Contact hosting support or use different port |
Email sent but not received | Spam filters or DNS not set | Check SPF/DKIM/DMARC, test with Gmail |
Step 7: Enable Email Logging for Debugging
Install an email log plugin like:
- WP Mail Logging
- Post SMTP (has built-in logs)
Benefits:
- View email delivery history
- Debug failed messages
- Confirm which plugin sent the email
Step 8: Use Domain Email (Not Gmail Free Address)
Always use domain-based emails like:
- ✅ admin@yourdomain.com
- ❌ mywebsitename@gmail.com
Why?
- Gmail/Outlook free accounts are limited or blocked for business use
- Many SMTP services reject generic addresses in From headers
- Better branding and authentication
Use Transactional Email Services for Reliability
If you send a lot of emails (eCommerce, memberships), use a dedicated transactional email API:
Service | Free Limit | Features |
---|---|---|
SendGrid | 100 emails/day | Webhooks, analytics |
Mailgun | 5,000/mo for 1st 3 months | Developer-friendly |
Amazon SES | Very cheap | Requires setup |
SMTP2GO | 1,000 emails/mo | Excellent deliverability |
Brevo (Sendinblue) | 300/day | SMTP + newsletters |
These services ensure high delivery rates, detailed logs, and bounce management.
Ensure Reliable Email Delivery in WordPress
SMTP is the only professional way to send emails in WordPress today. Avoid relying on the outdated mail() function that leads to undelivered messages.
To summarize:
- Use WP Mail SMTP or equivalent plugin
- Set up a trusted SMTP service (like SendGrid, Mailgun, Gmail)
- Configure DNS records (SPF, DKIM, DMARC)
- Test your setup regularly
- Use email logs for debugging
Your site depends on emails. Make them reliable, secure, and fast.