Skip to content
FluentSMTP logo

FluentSMTP

  • Home
  • Features
  • ResourcesExpand
    • Blog
    • Docs
  • FAQ
  • Our PluginsExpand
    • FluentForm

      Fluent Forms

      WPSocialNinja

      WP Social Ninja

      Fluent Support

      Fluent Support

      FluentCRM

      FluentCRM

      WPPayForm

      WPPayForm

      NinjaTables

      Ninja Tables

      Azonpress

      AzonPress

  • Get FluentSMTP
FluentSMTP logo
FluentSMTP

Miscellaneous

  • Token has been expired issue with GMAIL

Functionality

  • Using Multiple SMTP Connections with Fluent SMTP

Drivers

  • Set Up Amazon SES in Fluent SMTP
  • Connect Gmail or Google WorkSpace Emails with FluentSMTP
  • Setting Up Sendinblue Mailer in Fluent SMTP
  • Configure Mailgun in Fluent SMTP to Send Emails
  • Set Up the Pepipost Mailer in Fluent SMTP
  • Set Up the SendGrid Driver in Fluent SMTP
  • Configure SparkPost in Fluent SMTP to Send Emails
  • Setup Outlook with FluentSMTP
  • Set up Fluent SMTP with Any Host or Mailer
  • Configure Postmark in Fluent SMTP to Send Emails

Getting Started

  • Installing Fluent SMTP
  • Home
  • Docs
  • Drivers
  • Connect Gmail or Google WorkSpace Emails with FluentSMTP

Connect Gmail or Google WorkSpace Emails with FluentSMTP

Table of Contents
  • Configuring Fluent SMTP with Gmail or Google WorkSpace Emails
  • How to get API Key and Secret:
    • Create a new API credential project in Google Cloud Platform:
    • Enable Gmail API:
  • Set Up OAuth consent:
    • Create OAuth client ID credentials

You can see this video or follow steps by steps instructions bellow. If you are following this video, you need to Re-Authenticate Access Token later.

Having trouble sending emails from WordPress using your Gmail or Google Workspace account? We’re here to help! This is a step-by-step tutorial on setting up Gmail or Google Workspace SMTP with WordPress.

Configuring Fluent SMTP with Gmail or Google WorkSpace Emails #

Hover over settings and go to Fluent SMTP Dashboard. If this is the first time you are using Fluent SMTP you will see the list of available Mailer, go ahead and select Google WorkSpace.

Configuring Fluent SMTP for Gmail

If you already have one or multiple SMTP driver setups and now you want to add Google Workspace also then go to the Settings Tab of Fluent SMTP and select Add New Connection. Now again all the available mailers will appear from where you need to select Google WorkSpace.

Configuring Fluent SMTP for MailGun


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

Fluent SMTP Google Workspace

In this part, you need to setup “From Email“, “From Name“, “Application Client ID” and “Application Client Secret” and click the save button.

From Email: The “From Email” should be the email you verified with Google Workspace. Check the box to set the return path to match the from. The Return Path indicates where non-delivery receipts – or bounce messages – are to be sent. If unchecked, bounce messages may be lost. With this enabled,
you’ll be emailed using “From Email” if any messages bounce as a result of issues with the recipient’s email.

From Name: From name can be anything you want. The best practice is to use the combination of your name and company name. For example, I would choose something like “Jewel From WPManageNinja” where Jewel is the first name of the CEO and WPManageNinja is the company. The Application Client ID and Application Client Secret will be provided by Google Workspace.

How to get API Key and Secret: #

In this part, you have to go through multiple process, these processes are as below:

Create a new API credential project in Google Cloud Platform: #

Go to Google Cloud Platform by clicking on this link – https://console.cloud.google.com. From the dashboard click on the Select Project.

Select Project - Google Cloud Platform with Fluent SMTP

A popup will appear, click on the NEW PROJECT button.

Select New Project - Google Cloud Platform with Fluent SMTP

Give a Project name and hit on the CREATE button.

Give-a-Project-Name-and-Create-Google-Cloud-Platform-with-Fluent-SMTP

A notification will appear which will confirm that a project has been created.

A Notification Shown in Google Cloud Platform with Fluent SMTP

Now, if you have existing projects on your Google Cloud Platform, you need to select your newly created projects as default. To do that click on the dropdown as shown in the screenshot.

Click the Project Again - Google Cloud Platform with Fluent SMTP

Select the newly created project (For my case its FluentSMTP Connector), you can see a checkmark on the left side in the selected projects name.

Select The Project - Google Cloud Platform with Fluent SMTP

Enable Gmail API: #

Click on the Library from the left sidebar.

Click on The Library

On this page, you have to search for Gmail.

Search for Google

Click on the Gmail API.

Click Gmail

Now click on Enable button. It will take some time and will redirect you to Gmail API dashboard .

Enable Gmail

From the Gmail API dashboard, click on the Hamburger icon.

Click on the Hamburger from the Gmail API dashboard

Select APIs & Services -> Dashboard. It will redirect to Google Cloud Platform dashboard.

Go Back to Dashboard


Set Up OAuth consent: #

From the Hamburger Menu, click on the OAuth consent screen. You will get two radio item.

  1. If you are a Google Workspace user, select Internal so that it will bind with your workspace domain or email.
  2. For all other cases or every cases, you can choose External.
OAuth Consent

On this screen, you need to provide various information. In the App information section, Give an App name (It can be anything), select your email in the User support email section. You can add App logo too, but its not required.

App Information

In the App domain section, you can provide your homepage, privacy, terms & services links (Not required). But you must use your website url (without http:// or https://)

App Domain

In the Developer contact information, you can use any email so that google can notify you about any changes to your project.

Developer Contact and Save

Click Save and Continue button.

In the Scope section, you don’t have to add any details, just click Save and Continue button.

Scopes

This is a very important steps, we need to add the email that we will use as a sender. To do that, click on the ADD USERS button.

Add User

On the right popup, type your email address and click on the ADD button.

Add User Popup

You can always add/edit emails later from this screen. After adding the email as a user click on the Save and Continue button.

Test users - Save and Continue

Now from the same 0Auth consent screen option, click on PUBLISH APP button and confirm the setting.


Create OAuth client ID credentials #

Now go to Credentials fro the hamburger menu. Click on the Create Credentials button and select OAuth client ID.

Credential Settings

Select Desktop app as the Application type.

Select Desktop App

Give a name, you can type anything for example: FluentSMTP Token. Now hit the CREATE button.

Give a Name and Click on CREATE

You will be given a Client ID and a Client Secret on a popup window. Simply copy them by clicking the copy icon (at the right side).

Copy Client ID and Secret

Now add both Client ID and Client Secret in the respected field in Google Workspace connection setting as bellow. Click on the Authenticate button and it will redirect you to google.

Authenticate and get token

here you need to allow some access:

  1. Select the email.
  2. As your newly created app is a local app, google can’t verify it. Dont worry about the notice, click on Advanced option.
  3. Click Go to connector (unsafe) option.
  4. Check the Manage Drafts and send emails option and confirm your choice by clicking Continue.
  5. Copy the code by clicking on the copy button at the right side.

Now paste the code (that you just copied) in the Access Token box.

Save Connection Settings

You should see it saved as below.

Settings-Done

What are your Feelings
Share This Article :
  • Facebook
  • Twitter
  • LinkedIn
  • Pinterest
Still stuck? How can we help?

How can we help?

Updated on February 9, 2022
Set Up Amazon SES in Fluent SMTPSetting Up Sendinblue Mailer in Fluent SMTP

31 Comments

  1. Scott T says:
    June 28, 2021 at 8:44 pm

    Easy to set up. I have the Legacy G Suite (free account) for one of my businesses. I can’t find the daily email sending limit this kind of account would have. Or is that different than using this Google API service. Does anyone know? Thanks. 🙂

    Reply
  2. Zlatko Zlatkov says:
    June 29, 2021 at 8:57 am

    Hello, can you help me with this error:

    Fatal error: Uncaught TypeError: implode(): Argument #2 ($array) must be of type ?array, string given in /home/forge/perfektniatpodarak.bg/wp-content/plugins/fluent-smtp/includes/libs/google-api-client/vendor/google/apiclient/src/Google/Service/Resource.php:291 Stack trace: #0 /home/forge/perfektniatpodarak.bg/wp-content/plugins/fluent-smtp/includes/libs/google-api-client/vendor/google/apiclient/src/Google/Service/Resource.php(291): implode() #1 /home/forge/perfektniatpodarak.bg/wp-content/plugins/fluent-smtp/includes/libs/google-api-client/vendor/google/apiclient/src/Google/Service/Resource.php(190): Google_Service_Resource->createRequestUri() #2 /home/forge/perfektniatpodarak.bg/wp-content/plugins/fluent-smtp/includes/libs/google-api-client/vendor/google/apiclient-services/src/Google/Service/Gmail/Resource/UsersMessages.php(197): Google_Service_Resource->call() #3 /home/forge/perfektniatpodarak.bg/wp-content/plugins/fluent-smtp/app/Services/Mailer/Providers/Gmail/Handler.php(65): Google_Service_Gmail_Resource_UsersMessages->send() #4 /home/forge/perfektniatpodarak.bg/wp-content/plugins/fluent-smtp/app/Services/Mailer/Providers/Gmail/Handler.php(25): FluentMail\App\Services\Mailer\Providers\Gmail\Handler->sendViaApi() #5 /home/forge/perfektniatpodarak.bg/wp-content/plugins/fluent-smtp/app/Services/Mailer/Providers/Gmail/Handler.php(16): FluentMail\App\Services\Mailer\Providers\Gmail\Handler->postSend() #6 /home/forge/perfektniatpodarak.bg/wp-content/plugins/fluent-smtp/app/Services/Mailer/FluentPHPMailer.php(30): FluentMail\App\Services\Mailer\Providers\Gmail\Handler->send() #7 /home/forge/perfektniatpodarak.bg/wp-content/plugins/fluent-smtp/app/Functions/pluggable.php(393): FluentMail\App\Services\Mailer\FluentPHPMailer->send() #8 /home/forge/perfektniatpodarak.bg/wp-includes/user.php(3276): wp_mail() #9 /home/forge/perfektniatpodarak.bg/wp-includes/class-wp-hook.php(292): send_confirmation_on_profile_email() #10 /home/forge/perfektniatpodarak.bg/wp-includes/class-wp-hook.php(316): WP_Hook->apply_filters() #11 /home/forge/perfektniatpodarak.bg/wp-includes/plugin.php(484): WP_Hook->do_action() #12 /home/forge/perfektniatpodarak.bg/wp-admin/user-edit.php(142): do_action() #13 /home/forge/perfektniatpodarak.bg/wp-admin/profile.php(18): require_once(‘…’) #14 {main} thrown in /home/forge/perfektniatpodarak.bg/wp-content/plugins/fluent-smtp/includes/libs/google-api-client/vendor/google/apiclient/src/Google/Service/Resource.php on line 291
    Възникна фатална грешка на вашия уебсайт. Моля, преверете пощата на администратора на сайта за инструкции.

    Научете повече за отстраняването на грешки в WordPress.

    Reply
    1. Nazir Himel says:
      July 5, 2021 at 7:23 am

      This looks like a plugin conflict. Please disable any other SMTP plugin you’re using and if the problem still exists, contact our support: https://wpmanageninja.com/support-tickets/

      Reply
  3. jefferson felicio says:
    July 11, 2021 at 7:13 pm

    Credential Verification Failed. Please check your inputs

    o que seria isso

    Reply
    1. Nazir Himel says:
      July 17, 2021 at 9:55 am

      Looks like you’re trying to set up FluentSMTP with a different domain. for that, you have to follow the above process again.

      Reply
  4. Dave says:
    July 16, 2021 at 2:19 am

    Works great but after a few days it can’t send emails anymore,. So, I have to authenticate again with google and get another access token.
    Is it possible to get a refresh token? Is there a detailed tutorial for it?

    Thank you

    Reply
    1. Nazir Himel says:
      July 17, 2021 at 10:14 am

      Hi Dave, you can’t get a refresh token. Please do the process again and allow untrusted applications. You won’t have to go through this again.

      Reply
      1. Dave says:
        August 21, 2021 at 1:31 am

        Hi Nazir. I have allowed untrusted applications, but the problem remains.
        My gmail account doesn’t have a dual authentication protocol turned on and, as Kravel said, we have to keep getting a refreshed token.
        I would appreciate if you could help with a solution. Thank you.

        Reply
        1. Nazir Himel says:
          August 25, 2021 at 9:00 am

          Hi Dave, We have changed the Gmail API. Please check this doc to fix your issue: https://fluentsmtp.com/docs/token-has-been-expired-issue-with-gmail-or-google-workspace/

          Reply
  5. Ana L says:
    July 29, 2021 at 4:55 pm

    The configuration is well explained and is working really nice. But i would like that the email sender that appear in the messages wasn’t the gmail account, but another one. In the sender settings i have the name and e-mail i wanted to appear and i have all the check boxes marked, but when i test the form and send the e-mail its the gmail account that appears.
    Can you help me? Thanks!

    Reply
    1. Nazir Himel says:
      July 30, 2021 at 8:46 am

      This isn’t possible because it will cause spoofing. Even if other SMTP plugins support that your emails would still go to spam.

      Reply
  6. prem says:
    August 2, 2021 at 1:41 pm

    Can you guys tell me, what is this? Token Validity Valid (59m)
    after few days i need to do authenticate again. but why ? can’t be only one time authenticate it

    Reply
    1. Nazir Himel says:
      August 5, 2021 at 10:54 am

      perhaps your application token expired because there was a 60-minute limit. you should get a refresh token from here: https://developers.google.com/accounts/docs/OAuth2WebServer#refresh

      Reply
  7. Kralev Dance says:
    August 5, 2021 at 9:22 pm

    I have to keep getting a refreshed token so can you develop some sort of a workaround for this in a future update???

    I can see you mentioned to another user they would not have to do this again, but so far this is the 3rd time I’ve had to do it. I read the documentation and I know this is because the default style of access is called ‘online’ and I need to change it to ‘offline’ but I am not experienced enough with .php to know how to make those changes — even after reading the google developer documentation.

    I chose this plugin and Contact Form7 to avoid manually changing lines of code in my .php files and will most likely need to find another option!

    Reply
    1. Nazir Himel says:
      August 11, 2021 at 12:08 pm

      Hi Kralev, I asked you to get a refresh token because they usually do not expire soon. But if it’s expiring too often, this is due to a dual authentication protocol that has been set up on your Gmail account. In that case, please go for a manual configuration using the other email settings.

      Reply
  8. Pramod Kumar T G says:
    August 24, 2021 at 4:51 pm

    Hi, Is there a limit on the number of email that can be sent in a day with Gmail/Google Workspace option?

    Reply
    1. Nazir Himel says:
      August 25, 2021 at 8:38 am

      Yes, you can’t send more than 2000 emails per 24 hours.

      Reply
  9. Montassar Billeh Hazgui says:
    September 4, 2021 at 8:08 am

    Does it supports bounced emails like SES?

    Reply
    1. Nazir Himel says:
      September 7, 2021 at 1:42 pm

      Hi Montassar, FluentSMTP doesn’t have bounce handling for Gmail. You can set it up with others.

      Reply
  10. Vanity says:
    September 9, 2021 at 5:21 pm

    Thanks for the detailed guide. I managed to successfully configure it but some of the test mails failed. I mean “SOME” because a few passed. Any reason why? I’ve included the technical error message.

    {
    “code”: 400,
    “message”: “SimpleEmailService::sendRawEmail(): Sender – MessageRejected: Email address is not verified. The following identities failed the check in region US-EAST-1: umar.f2011@gmail.com\nRequest Id: 7a67afdd-d2e0-43ff-81e2-14a4875a53c8\n”,
    “errors”: [
    “SimpleEmailService::sendRawEmail(): Sender – MessageRejected: Email address is not verified. The following identities failed the check in region US-EAST-1: umar.f2011@gmail.com\nRequest Id: 7a67afdd-d2e0-43ff-81e2-14a4875a53c8\n”
    ]
    }

    Reply
    1. Nazir Himel says:
      September 11, 2021 at 8:51 am

      Hi, I think you haven’t verified your email address yet. Please verify the address and it should work.

      Reply
  11. Josu says:
    September 24, 2021 at 2:15 pm

    the plugin is amazing, i connected with gmail. With gmail i have a limit of only 100 mail per day? Is there any way to increase this limit?

    Reply
    1. Nazir Himel says:
      September 27, 2021 at 12:24 pm

      No, Gmail only allows for sending 100 emails per day. You might want to try Sendinblue or MailGun.

      Reply
  12. Mahendra Chandrawat says:
    November 7, 2021 at 8:51 pm

    how to send contactus form email on gmail account ?

    Reply
    1. Nazir Himel says:
      November 29, 2021 at 4:00 am

      Do you mean you want to get email notifications for people that contact you through your website’s contact form? For that, you’ll have to set your Gmail address as the admin email notification address.

      Reply
  13. George says:
    November 28, 2021 at 7:51 pm

    All the messages I tried to send are blocked:

    Message blocked
    Your message to xxxx@xxxxxxx.co.uk has been blocked. See technical details below for more information.

    Reply
    1. Nazir Himel says:
      November 29, 2021 at 4:08 am

      Please check the technical details and reach out to our support.

      Reply
  14. Alexander Zubkov says:
    December 19, 2021 at 5:56 pm

    Error 401: invalid_client
    The OAuth client was not found.

    Reply
    1. Alexander Zubkov says:
      December 19, 2021 at 10:53 pm

      user error. Fixed

      Reply
  15. Victor says:
    January 19, 2022 at 10:47 pm

    This is the third time I have followed these instructions exactly. This is the third time everything has worked fine. I still don’t understand how it all works, but it is nice to have three sites sending messages without problems.

    Reply
  16. Victor says:
    January 21, 2022 at 2:54 am

    I followed the instructions exactly for a fourth time. Worked again. The “unsafe” messages are a bit scary, so I hope someone explains the warnings a little better.

    Reply

Leave a Reply to Kralev Dance Cancel reply

Your email address will not be published. Required fields are marked *

Table of Contents
  • Configuring Fluent SMTP with Gmail or Google WorkSpace Emails
  • How to get API Key and Secret:
    • Create a new API credential project in Google Cloud Platform:
    • Enable Gmail API:
  • Set Up OAuth consent:
    • Create OAuth client ID credentials
FluentSMTP logo

© 2022 FluentSMTP A Brand of  WPManageNinja™ | Get Support | Terms & Privacy

  • FluentCRM
  • Fluent Forms
  • Ninja Tables
  • FluentSupport
  • WPSocialNinja
  • WPManageNinja
  • Home
  • Features
  • Resources
    • Blog
    • Docs
  • FAQ
  • Our Plugins
    • Fluent Forms
    • FluentCRM
    • Ninja Tables
    • WP Social Ninja
    • WPPayForm
    • AzonPress
  • Get FluentSMTP