Because Gmail/Google Workspace has disabled basic authentication in SMTP/POP/IMAP services, you have to use modern authentication (OAUTH) to login Gmail SMTP/POP/IMAP service.
To use OAUTH, the access token is required. There are two ways to retrieve the access token from Google server:
This tutorial introduces the first way which requires user login by web browser.
To use Gmail OAuth in your application, you should create a project in the Google Cloud Console, go to Menu > IAM & Admin > Create a Project:
In the Google Cloud console, go to Menu ->APIs & Services
->Dashboard
->OAuth consent screen
, selectInternal or External
user type, input necessary information and click Save.
If you only want to use the project for internal users (Google Workspace accounts), Internal type is recommended.
APIs & Services
-> Dashboard
-> Credentials
Credentials
-> Create Credentials
-> OAuth client ID
-> Web application
or Other (Desktop Application)
. It depends on your application type.Please select Other (Desktop Application)
if you are using EA Oauth Service.
"Create"
, you will get client id
and client secret
, download and save them for later use."Library"
-> Search "Gmail"
, then click "Gmail API"
and enable it."OAuth consent screen"
-> "Edit App"
..../auth/userinfo.email
, .../auth/userinfo.profile
, openid
and https://mail.google.com/
scopes in OAuth consent screen
-> Edit App
-> Scopes
-> Add or remove scopes
.If you use OAuth in a web application, you should use a web page or controller to
get authorization code from Google OAuth Server.
So, you need to add your page or web application routing path to Authorized Redirect URIs
in APIs & Services
-> Dashboard
-> Credentials
->
OAuth 2.0 Client IDs
-> Your Client ID
.
To use the OAUTH in EA Oauth Service, you don’t need to add redirect URIs.
By default, your app is in test mode, you should add the user email address to the test users, then the user can test your app.
Go to OAuth consent screen
-> Test users
-> Add users
-> input the user email address.
If you want to publish your app, you should submit your app for verification by clicking “Publish”. For internal type project, you don’t need to submit your app for verification.
If you only use your project with limited users, you don’t have to publish your app, just add the user email address to the test users.
If your users are seeing the “unverified app” screen, it is because your OAuth request includes additional scopes that haven’t been approved. The user can still choose to proceed with the request, but the app will be limited in the number of users that can grant permission to your app when requesting unapproved sensitive or restricted scopes.
Learn more detail from: https://developers.google.com/workspace/guides/create-project.
You can use the client id
, client secret
in third-party application that supports OAUTH.
If you have a legacy email application doesn’t support OAUTH, the following third-party application can use the
client id, client secret value and tenant to help your application to connect Gmail.
Not enough? Please contact our technical support team.
Remarks
We usually reply emails within 24hours. The reason for getting no response is likely that your SMTP server bounced our reply. In this case, please try to use another email address to contact us. Your Gmail, Hotmail or Office 365 email account is recommended.