Gmail or Google Workspace with FluentSMTP

FluentSMTP is a plugin that takeover WordPress’s default mailing system and ensures email delivery from the website and also keeps logs of them. The unique feature of FluentSMTP is that it can be configured with multiple email delivery methods(connections) and all of them can be used later by configuring the Mail From address.

Google is one of the best email delivery methods available in the market. Both Free and Paid (Google Workspace formerly known as GSuite) emails can be configured with FluentSMTP. In this tutorial, we are going to configure FluentSMTP with Google.

Configuring FluentSMTP with Gmail or Google Workspace Emails #

Please follow the below sections to configure Gmail or Google Workspace Emails with FluentSMTP.

Add New Google Workspace Connection #

If you already have any other configured connection, then you will be in the FluentSMTP Dashboard.
Please go to WordPress Settings ⮕ FluentSMTP ⮕ Settings ⮕ Add Another Connection

If you haven’t set up any SMTP Connection yet, you will be directed to configure a connection automatically.
Now from your WordPress Dashboard go to Settings ⮕ FluentSMTP

Google Workspace Connection Properties #

After selecting Google Workspace as the mailer, a very simple settings window will open as shown in the screenshot below.

In this part, we need to provide From Email, From Name, Application Client ID, and Application Client Secret where the Client ID & Secret has to be obtained from the Google Cloud Platform for the From Email we are going to use for this Google Workspace Connection. We will obtain those credentials from the following steps.

Obtain Google Cloud Application Client ID & Client Secret #

The Application Client ID and Client Secrets are parts of the Google Cloud Application. We need to:

Please go to Google Cloud Platform from Here: Home – Google Cloud Platform

The first time accessing Google Cloud Console, you may see a popup asking you to select your country and agree to the Terms of Service. Go ahead and do so, then click on AGREE AND CONTINUE to move on to the next step.

Click on the App Registration Link

Create a new Project #

Upon accepting the Terms of Service we will be asked to select a Project. For totally new accounts accessing the Cloud Console, create a Project to get started with the Cloud Console. The option for creating a new project can be found in the top right corner with the NEW PROJECT button under Select a Project.

Enable Gmail API #

After creating the Project google will redirect us to the project dashboard. Now we need to Enable the GMAIL API for the project. We can find the option for enabling API & Services from APIs &Services > Enabled API & Services from the left sidebar as the below screenshot.

In the search bar search for “Gmail API“. This will list the GMAIL-related API services. We just need the Gmail API. Now click on the Gmail API and it will take us to the Gmail API page.

Now we need to Enable the API by clicking on the ENABLE button below.

Create Credentials #

It takes a few seconds to enable the API and then redirect us to the GMAIL API Dashboard as below. This time we need to create the credentials for FluentSMTP by clicking on CREATE CREDENTIALS button on the top right side of the page.

For Credential Type, we need to select the USER DATA as the target accessible data and GMAIL API as the target GMAIL API that is selected by default.

Now for OAuth Consent Screen, Give a name for the App Name, an email address for the support email, and also an email for the developer’s contact information. The email addresses are used as the Email Address we will be used to deliver emails from WordPress using the FluentSMTP plugin. Once the inputs are done click on SAVE AND CONTINUE.

For FluentSMTP email delivery, we do not need to do anything for SCOPES options. You can still configure your own requirements if you need to.

Now for OAuth Client ID, we need to select the Application Type as Web Application and provide a name for the application.

In the next step, we will be offered a Client ID as a credential. We can skip downloading or saving it as of now and click on DONE as we just finished creating the credentials for FluentSMTP which we will collect later in this tutorial.

OAuth Publish App #

Now we need to publish the app we just created. Go to OAuth Consent Screen from the left sidebar and we will find our app FluentSMTP there. Now click on the PUBLISH APP right under the Testing section.

When asked to confirm, Please click on CONFIRM from Pust to Production popup window.

Collect Credentials #

Now we will collect the credentials we need. Go to Credentials from the left sidebar. Find the Project Name we created as “FluentSMTP” and click on the Edit icon from the right side as below.

Now the Client ID and Client Secret will be shown on the right side. We need to copy these 2 values and put them into FluentSMTP Connection settings in the next steps.

FluentSMTP Google Workspace Settings #

Application Details #

Now we need to put the Client ID and Client Secret as we created and collected earlier in the previous steps. Now click on the “Authenticate with Google & Get Access Token”.

Generating Access token for FluentSMTP #

This will redirect us to the FluentSMTP server and in the process, Google will ask for the account that you want to allow access to your Gmail or Google Workspace account.

Then you will see an approval window to approve your project to access the user information from the Google Cloud Project. Please click on Continue to proceed to the next step.

This will take us to the FluentSMTP Server and provide us with a generated Access Token. Click on Copy to copy the access token that we need in the next step.

Save Google Workspace Connection Settings #

Now we are in the last step to configure our FluentSMTP with the Google Workspace or Gmail Email address. Input the copied access token from the earlier step in the FluentSMTP connection setting and then Save the connection.

Access Keys Storage #

  • Store Access Keys in DB: By default, this is enabled and strongly recommended. This will keep the information in the Databases in Encrypted format.
  • Access Keys in Config File: This allows you to store the access keys in the following section inside the wp-config.php file by the following directives.

Simply copy the following snippet and replace the stars with the corresponding credential. Then simply paste it to the wp-config.php file of your WordPress installation

define( 'FLUENTMAIL_GMAIL_CLIENT_ID', '********************' );
define( 'FLUENTMAIL_GMAIL_CLIENT_SECRET', '********************' );

That’s all about Configuring FluentSMTP with Gmail or Google Workspace Emails to send emails from the WordPress website. Additionally, it is recommended to Send a test email, Test Email Confirmation, and then Confirm Test Email Deliverability.

Add your first comment to this post