Setting up the Gmail API for Post SMTP Mailer for WordPress

So you have a WordPress website you need it to send emails. One of the best plugins to help you do this is the Post SMTP plugin for WordPress.

This highly popular plugin allows you to send emails from your website using Gmail, SMTP an a host of other email server protocols.

This article will help you setup the Gmail API option.

To setup your WordPress site to send emails using the Gmail API:

Step 1: Install the Post SMTP Mailer/Email Log

  1. Jump to Plugins in the back of your WordPress website.
  2. Click the “Add New” link at the top of the page.
  3. In the “Search Plugins” field in the top right, enter “Post SMTP”.
  4. In the search results, you will see “Post SMTP Mailer/Email Log”. Click the [Install Now] button.
  5. Click the [Activate] button after it has installed.

Step 2: Tell Post SMTP Mailer how to use the Gmail API

  1. In the left hand bar of your WordPress back-end, click the Post SMTP menu.
  2. Click the “Show All Settings” link.
  3. In the “Type” setting, select “Gmail API”.

Step 3: Create API Settings

This part of the process is long BUT stay with it. Follow the bouncing ball and you’ll be fine.

  1. Ensure you have a Google account. If you don’t have one yet, you can set one up here – Setup a new Google Account.
  2. Login to your Google account.
  3. Jump to https://console.developers.google.com/start/api?id=gmail.
  4. Make sure that the “Create a project” is selected.
    Postman SMTP Gmail API Step 01 Create new Project
  5. Click the [Continue] button.
  6. Under the heading “Find out what kind of credentials you need”, click the “API Key” link.
  7. Give the Key a name, e.g. WordPress Email key.
    Postman SMTP Gmail API Step 02 API Key details
  8. Click the [Create] button.
  9. A screen will show stating “API key created”.
  10. Click the [Close] link.
  11. In the “Credentials” tab, click the [Create Credentials] drop down.
  12. Select OAuth client ID.
  13. In the “Credentials” screen, select the “Web application” option.
  14. Enter a name for the “Name” setting, e.g. Website Emails.
  15. Copy the “Authorized JavaScript origins” and “Authorized redirect URIs” settings from the Post SMTP screen.
  16. Copy these back into the Gmail API screen. NOTE, when you copy and paste a setting a new field shows below the field that you just pasted into. Ignore this new field.
  17. Click the [Create] button.
  18. A screen will show with the Client ID and Client Secret. These are the settings that you copy and paste back into the Post SMTP settings.
  19.  Copy the Client ID and Client Secret from this screen back into the Post SMTP settings.
  20. Click [Save Settings].

Step 4: Link Post SMTP to the API Settings

Now that you have the ID’s in your WordPress website, you will need to grant permission to Google to allow Post SMTP to talk to it.

  1. Click the link “Grant permission with Google” at the top of the page.
  2. Click the [Allow] button.

Step 5: Test the Settings

  1. Jump back to the Postman settings page.
  2. Click the “Send a Test Email” link.
  3. Check your emails to confirm that the email was sent successfully.

Share this post