WP_SMTP

Configure SMTP for Outbound Emails with Gmail on WordPress

If you’re running a WordPress site and need to send emails to your users, you may have encountered issues with emails not being delivered or landing in spam folders. Fortunately, the WP Mail SMTP plugin can help solve these problems by configuring your email settings to work with an external mail service like Gmail. In this blog post, I’ll walk you through the steps to configure WP Mail SMTP with your Gmail account so you can start sending reliable and trustworthy emails from your WordPress site.

Step 1:

1) Login to WordPress admin portal ( Default link would be: < your_wp_site >/wp-admin )

2) Go to the “Plugins” section and select the “Activate” option for the “WP Mail SMTP” plugin.

Once activated, Select Settings under WP Mail SMTP on the left pane > Scroll to Mailer Section and Select Google/Gmail

Step 2:

Go to Google Cloud Platform and navigate to Enable API wizard to register your application for Gmail API ( Click here to directly go to Enable API wizard )

Click on Create Project 

After few seconds, click on Next > then click on ENABLE to enable Gmail API

Go to APIs & Services > Credentials > Create Credentials > OAuth client ID

Click on ‘Configure OAuth consent screen’ > Give a App name > Enter your email and Developer contact information > Click on Save and Continue

In Scopes and Tests Sections > Click on Save and Continue ( No changes to be made )

Once the consent screen is created, Go to APIs & Services > Credentials > Create Credentials > OAuth client ID

Select Web application as the application type > Give a Name or Leave it as Default > Click on ADD URI

Enter your Site URL in the ADD URI section

Click on ADD URI under Authorized redirect URIs and enter https://connect.wpmailsmtp.com/google/ as the URI

Finally, Click on Create and Copy the Client ID and Client Secret to a Notepad

Step 3:

Navigate back to WordPress and Continue the Plugin Setup

Enter Client ID and Secret generated from the previous step 

Navigate back to APIs & Services > OAuth consent screen in Google Cloud Console > Click on Publish App > Click on Confirm

Go back to the WordPress plugin settings and click on Save Settings

Authorize by Login into the Google Account

Thats it !!! Now you have configured mails to be sent using your gmail account.