How to Fix WordPress Not Sending Emails: FluentSMTP & Gmail API Guide
Is your WordPress contact form not sending emails? You aren’t alone. By default, WordPress uses the PHP Mail function, which most modern email providers (like Gmail and Outlook) flag as spam.
In this guide, we will walk you through the professional way to fix email deliverability using FluentSMTP and the Google Gmail API. This setup ensures your leads land in the inbox every single time.
Why Your WordPress Emails Go to Spam
Most web hosts aren’t configured for email. When your site sends a message via PHP, it lacks “authentication”—essentially, it has no ID. Major email providers see this anonymous mail and block it to protect users. Using an SMTP (Simple Mail Transfer Protocol) with an API connection gives your emails a verified digital signature.
Step 1: Install the FluentSMTP Plugin
FluentSMTP is a lightweight, open-source, and free plugin that replaces the default WordPress mail function.
- Navigate to Plugins > Add New in your WordPress dashboard.
- Search for FluentSMTP, install, and activate it.
- Go to Settings > FluentSMTP and select Google Workspace / Gmail as your connection.
- Copy the Authorized Redirect URI shown in the settings. You will need this for the Google Cloud Console.
Step 2: Create a Google Cloud Project
To use the Gmail API, you need to “introduce” your website to Google.
- Go to the Google Cloud Console.
- Click Select a project > New Project.
- Name your project (e.g., “Website Contact Form”) and click Create.
- From the sidebar, go to APIs & Services > Library.
- Search for Gmail API, click it, and hit Enable.
Step 3: Configure the OAuth Consent Screen
Google needs to know who is requesting access.
- Go to APIs & Services > OAuth consent screen.
- Select External and click Create.
- Fill in your App Name (your website name) and User support email.
- Scroll to Developer contact information and enter your email.
- Click Save and Continue through the next steps until you return to the dashboard.
- Crucial: Click Publish App under the “Testing” status so your connection doesn’t expire every 7 days.
Step 4: Generate your API Credentials
- Go to APIs & Services > Credentials.
- Click + Create Credentials and select OAuth client ID.
- Select Web application as the type.
- Under Authorized redirect URIs, paste the URL you copied from FluentSMTP in Step 1.
- Click Create. Copy the Client ID and Client Secret that appear.
Step 5: Connect FluentSMTP to Google
- Return to your WordPress dashboard (Settings > FluentSMTP).
- Paste your Client ID and Client Secret.
- Enter your Gmail address in the From Email field.
- Check the box for “Set return-path to match from email” to improve deliverability.
- Click Authenticate with Google. A popup will appear.
- Note: You may see a “Google hasn’t verified this app” warning. Click Advanced > Go to [Your Project Name] (unsafe) and click Allow.
Step 6: Test Your Deliverability
- In FluentSMTP, go to the Email Test tab.
- Send a test email to your personal address.
- Check your inbox (and spam folder) on your phone or computer.
- If it arrives, your setup is perfect!
Pro-Tip: Spam Protection
Even with a perfect email setup, you should protect your forms from bots. We recommend using Cloudflare Turnstile or a Honeypot field within your form builder (like Bricks or Elementor). This keeps your inbox clean and ensures you only receive high-quality leads.