This article walks you through setting up Gmail SMTP for your WordPress website using the WP Mail SMTP plugin and Google Cloud Console. This configuration allows you to send emails securely via Gmail instead of relying on your hosting server.
Prerequisites
-
A Gmail or Google Workspace account
-
Admin access to your WordPress site
-
Access to Google Cloud Console
Step 1: Create a Project in Google Cloud
-
Go to Google Cloud Console.
-
Log in with your Google account.
-
Click Create Project, name it (e.g., Gmail SMTP), and click Create.
Step 2: Enable the Gmail API
-
In the Google Cloud Console, navigate to APIs & Services > Library.
-
Search for Gmail API, click it, and then click Enable.
-
Click Create Credentials to begin setting up your OAuth access
4. Click Create Credentials to Generate Client ID.
Step 3: Set Up OAuth Consent Screen & Credentials
-
Go to Credentials > OAuth consent screen.
-
Choose User Type as External, then click Create.
3. Fill in:
-
App name: SMTP
-
User support email: Your Gmail address
-
Click Create and copy both the Client ID and Client Secret.Developer contact email: Your Gmail address
4. Skip scopes and click Save and Continue.
-
-
5. Under Credentials, click Create Credentials > OAuth Client ID.
-
Application type: Web application
-
Name: Web Client 1 (or your choice)
-
Authorized JavaScript origins:
https://yourdomain.com
-
Authorized redirect URI:
https://connect.wpmailsmtp.com/google
Step 4: Publish the App-
Go back to OAuth Consent Screen.
-
Click Publish App to switch from testing to production mode.
Note: Testing mode limits usage to 100 users. Publishing removes this limit.
Step 5: Configure WP Mail SMTP PluginInstall the Plugin
-
Go to your WordPress dashboard.
-
Navigate to Plugins > Add New.
-
Search for WP Mail SMTP, install, and activate it.
Configure the Plugin
-
Go to WP Mail SMTP > Settings.
-
Fill in:
-
From Email: Your Gmail address
-
Force From Email: Enabled
-
From Name: e.g., "Test Email"
-
Mailer: Google
-
-
Paste your Client ID and Client Secret from Google Cloud.
-
Save the settings.
-
Authorize Gmail
-
Click Allow plugin to send emails using Google.
-
Log in to your Google account and grant permissions.
-
If prompted with a warning, click Advanced > Go to WP Mail SMTP and continue.
-
You’ll be redirected back to your site once authorization is complete.
Step 6: Disable WordPress Hosting Pro Mail System
-
In your WordPress dashboard, go to Settings > General.
-
Disable the WordPress Hosting Pro Mail System to allow WP Mail SMTP to take over.
Step 7: Test the Configuration
-
Install the WP Mail SMTP Email Test plugin (if not included).
-
Go to WP Mail SMTP > Tools > Email Test.
-
Send a test email.
-
Look for the message: “Email has been sent!”
-
Check your inbox to confirm delivery.
You’ve now configured Gmail SMTP on your WordPress website. This setup improves deliverability and ensures your site uses Gmail’s secure and reliable email service.
-
-
-
-
-