A person using a computer, with verified succesful e-mail

Create the “from e-mail” user

  • Open IAM & admin tab
  • Click the

    at the top to add a new user
  • Create a new user, you will use this later for from address for your WordPress e-mail

Generate API Key

  • Navigate to APIs & Services > Credentials
  • From the credentials page, click the

  • Select API Key

    • It will generate an API key, copy this and set it aside. You will need it later.

Download and install the G-mail SMTP Plugin

  • Login to your WordPress admin page, and navigate to Plugins tab, “Add New”
  • Download and install the Gmail SMTP plugin
  • Note: Installing Plugins through the WordPress page requires FTP access on your site. If you do not have FTP access, please use this alternative method. We will cover configuring FTP in a future tutorial.
  • Install WordPress plugin directly

    • Navigate to the page for g-mail SMTP plugin, or right click this link and copy paste the following https://downloads.wordpress.org/plugin/gmail-smtp.zip
    • Login to your Compute Engine webserver instance
    • cd to your WordPress Root Install directory

      • Typically /var/www/html/
      • If you are not sure, it is the directory that contains wp-config.php
      • Cd /var/www/html/wp-content/plugins
      • Wget [path to gmail smtp file]
      • Unzip [gmail smtp .zip file]
  • The G-mail SMTP plugin is now installed, navigate back to the plugin page and you will now see it displayed, click to Activate the plugin

Enable G-Mail API

From the API Library Page in Google Console, find the G-Mail API and enable

Create Oauth Consent Screen

  • APIs & Services > Credentials > OAuth Consent Screen
  • Fill out the required information, e-mail address (use the e-mil address for your from address specified earlier)

Create Credentials for Gmail API

  • API & Services > Create Credentials > OAuth Client id
  • Select Web application
  • Enter a name
  • Browse to Gmail SMTP Plugin Settings page, copy the Authorized Redirect URI
  • Paste into the Authorized redirect URI field
  • Once you enter it, you will receive back your Client ID and your Client secret. Copy and paste these into a notepad and save for later

Configure G-Mail SMTP Plugin

  • From the Plugin Page still, click Settings to pull up the g-mail SMTP plugin settings
  • Use the Client ID, Client Secret from your notepad from previous steps
  • Use the from e-mail address created earlier for the OAUTH E-mail and From address
  • Fill out the from name, select TLS for encryption and select save changes
  • Click “Grant Access” at the bottom
  • Send a test e-mail, and verify that everything is working successfully

Next: Configure VPN for Secure Access in Google Cloud Platform

Comments are Closed