
You’re not alone if you’re experiencing issues with WordPress not sending emails. Many WordPress users encounter this problem, especially when using contact forms or sending order confirmations. The frustrating part? No error messages, no log files—just silence.
In this guide, I’ll show you how to troubleshoot and fix the problem using Post SMTP to connect WordPress with Gmail. You’ll be able to reliably send emails that land in inboxes, not spam folders.
We’ll walk through:
- Why WordPress Doesn’t Send Emails by Default
- Why Post SMTP is the Best Solution
- Step 1: Installing Post SMTP
- Step 2: Setting Up Gmail API
- Step 3: Connecting Post SMTP to Gmail
- Step 4: Sending a Test Email
- Common Issues and Troubleshooting
Full Video
Why We Have a “WordPress Not Sending Emails” Issue
Out of the box, WordPress isn’t configured to send emails effectively. It tries to use PHP’s mail() function, which isn’t reliable for transactional emails.
Here’s why:
- No Authentication: Emails sent via PHP mail lack the necessary authentication, which causes them to be flagged as spam.
- Poor Deliverability: Many hosting providers block outgoing email by default to prevent spam.
- No Error Messages: You won’t get an error notification when an email fails, making troubleshooting difficult.
Solution: Use an SMTP (Simple Mail Transfer Protocol) plugin like Post SMTP to authenticate and send your emails through a secure provider like Gmail.
Why Post SMTP is the Best Solution
Post SMTP is a reliable and feature-rich plugin that ensures your emails get delivered. It supports multiple SMTP services, but we’ll focus on connecting it to Gmail because:
- Gmail Improves Deliverability: Google’s servers are less likely to be flagged as spam.
- Free to Use: Emails sent via Gmail API are free at low to moderate volumes, making them perfect for small businesses and consultants.
- Works with Popular Plugins: Post SMTP integrates seamlessly with Contact Form 7, Elementor, Gravity Forms, WPForms, and more.
Pro Tip: If you prefer a more professional sender email (like orders@yourdomain.com), consider using services like SendGrid, Mailgun, or Amazon SES.Step 1: Installing Post SMTP
First, we’ll install and activate the Post SMTP plugin.
- Go to your WordPress Dashboard.
- Click Plugins > Add New.
- Search for Post SMTP.
- Install and activate the plugin by Saad Iqbal.

Step 2: Setting Up Gmail API
We need to set up the Gmail API to send emails using Gmail.
1. Create a New Project in Google Cloud Console
- Visit Google Cloud Console.
- Click Create Project and name it something like
Post SMTP. - Click Create and wait for the project to initialize.

2. Enable Gmail API
- Go to APIs & Services > Enable APIs & Services.
- Search for Gmail API and click Enable.

3. Set Up OAuth Consent Screen
- Navigate to OAuth Consent Screen.
- Choose External as the user type.
- Add your email as the support contact and save.
4. Create OAuth Credentials
- Go to Credentials and click Create Credentials > OAuth Client ID.
- Select Web Application.
- Add your Authorized JavaScript Origins and Redirect URIs provided by Post SMTP.
- Click Create and copy your Client ID and Client Secret.

Step 3: Connecting Post SMTP to Gmail
Once we have the Gmail API credentials, it’s time to connect them to WordPress.
- Go to Post SMTP > Setup Wizard.
- Select Gmail API as your mailer.
- Enter your Client ID and Client Secret.
- Authorize your site to send emails using your Gmail account.

Success Message: After authorizing, you should see a green success message:
“OAuth 2.0 authorization was successful.”
Step 4: Sending a Test Email
To confirm that everything works properly, send a test email.
- In the Post SMTP settings, go to the Test Email section.
- Enter an email address and click Send.
- Check your inbox to verify that the test email arrived.

Common Issues and Troubleshooting
If you encounter problems after setup, check these common issues:
1. Email Not Arriving?
- Check your Spam Folder.
- Wait a few minutes and try again.
- Ensure the OAuth consent screen is correctly configured.
2. Invalid Credentials Error
- Double-check your Client ID and Client Secret.
- Make sure the redirect URI matches exactly.
3. Authentication Error
- Relaunch the setup wizard from the Post SMTP dashboard and reauthorize the connection to your Gmail API.

Alternatives to Gmail for Email Sending
If Gmail isn’t the right fit for your website or if you need a more professional sender address, consider these alternatives:
- SendGrid: High email deliverability with API access.
- Mailgun: Ideal for developers needing detailed email analytics.
- Amazon SES: Low-cost, scalable email sending.
Final Thoughts
You’ve successfully fixed the “WordPress not sending emails” problem by setting up Post SMTP with Gmail. Whether you’re using Contact Form 7, Elementor, or WooCommerce, your WordPress site is now equipped to send emails reliably.
Thanks for following along!




