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
Set API Scopes/Users
Create Credentials
1 | Click "Credentials" on the left sidebar, then the "+ CREATE CREDENTIALS" at the top. |
Image RemovedImage Added |
2 | Choose "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 |
---|
title | MailSender (Desktop Application) |
---|
| Choose "Desktop app" for Application type and name the app something similar to " |
|
Gmail Mailsender Client". Then click Create. |
Expand |
---|
title | Interact 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 Added |
4 | When 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 |
5 | These credentials can then be found on the dashboard if they need to be edited or viewed later. | Image Added |
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.
...
1 | Click "OAuth consent screen" on the left sidebar, then the "PUBLISH APP" button under Testing | Image Added |
| Confirm on the pop up | Image Added |
3 | Ensure 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 Added |
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. |
...