Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.

In order to connect to the gmail smtp server with a more secure connection, a client ID and secret is needed to authorize the specific app. These will be obtained from within the google account settings page. Therefore, access to the google account username/password is required for these steps. These steps can be done without cost this way because there's no need for a Google Organization or Workspace to be created.

Create a new API Project

1

Open the Google API Console. It should look something like this.

Image Modified

2Click "CREATE PROJECT" on the far right.
3Choose a Project name like "Gmail SMTP" or similar, then click "Create"

Image Modified

4Once the project is finished creating, click "ENABLE APIS AND SERVICES" on the main dashboard(:

Image Modified

5Search for and Select the Gmail API

Image Modified

6Click Enable.

Image Modified


Set API Scopes/Users

1On the left sidebar, click "OAuth consent screen". Choose "External", then click the Create button.

Image Modified

2Enter information for your app. This will appear when logging in and asking for permissions. An app name like "Gmail SMTP" works here. Click "SAVE AND CONTINUE"


Note: Encountered issues with this step on 3/9/23. App information could not be saved until Project ID was added to the App Name field.

Once added no further issues were encountered.

Image Modified

3Click "ADD OR REMOVE SCOPES"

Image Modified

4Filter on "mail.google.com", click the checkbox next to that result. Then click "Update" at the bottom of the screen(may need to scroll down to see it).

Image Modified

5At the bottom of the screen there should now be an entry in the "Your Restricted Scopes" table. Click "SAVE AND CONTINUE"

Image Modified

6Click "+ ADD USERS". Add the email addresses of anyone that may use or request permissions from this API/app. When all are added, click "SAVE AND CONTINUE"

Image Modified


Create Credentials


1Click "Credentials" on the left sidebar, then the "+ CREATE CREDENTIALS" at the top.

Image Modified

2Choose "OAuth client ID"

Image Modified

3


Info

This step differs for mailsender and InteractServer. Please expand and follow the section for the app being used.


Expand
titleMailSender (Desktop Application)

Choose "Desktop app" for Application type and name the app something similar to "Mailsender Client". Then click Create.


Expand
titleInteract Server (Web Application)
  • Application type: Web Application
  • Name: something like "InteractServer Email"
  • Authorized JavaScript Origins
    • Click "Add URI"
    • enter into the box: https://localhost:5000
  • Authorized redirect URIs
    • Click "Add URI"
    • enter into the box: https://localhost:5000
  • Click Create



Image Modified

OR

Image Modified

4When the credentials are shown, copy the Client ID and Secret. These are the credentials that will be used when setting up the mail sender client. Or download the json which contains all the info as well.

Image Modified

5These credentials can then be found on the dashboard if they need to be edited or viewed later.

Image Modified


Publish App

This step is required to ensure our tokens don't expire and inconvenience users. We "publish" but don't do any of the verification steps needed to actually get verified/published from google. Just doing this first step puts our app into "In Production" publishing status and makes the refresh tokens last indefinitely.

1Click "OAuth consent screen" on the left sidebar, then the "PUBLISH APP" button under Testing
Image Modified

2

Confirm on the pop up

Image Modified

3Ensure the screen looks like the screenshot on the right. There will be a warning that verification is needed, we're not going to do that.

Image Modified


Info

This entire process can be repeated multiple times if needed, however there is a limit to the number or projects and users that can be added.

...