Set up Oauth 2.0
Last updated
Last updated
Recently Google and Microsoft changed their authentication method to send e-mails
With both you can either use the OAuth (method 2) authentification or the user/password (method 1), but note that the user/password and not the credentials you use to connect to your mailbox but application password that need to be created.
First make sure to be admin on your Google account, then follow these steps to generate your credentials:
Go to the Google cloud console dashboard and select a project (or create a new one)
Go to APIs and services => Library, search for Gmail API and enable it
On the overview page, click the Create credentials button (if this is not available, so to the APIs and services => Credentials menu)
You can skip the scope section by clicking the Save and continue button
Select Web application, then in the Authorised redirect URIs section, add the Redirect URL that is shown in your AcyMailing configuration page. Note that it may differ if your administration URL has been customised: - https://www.example.com/administrator/ for Joomla websites - https://www.example.com/wp-admin/ for WordPress websites
Go to OAuth consent screen, then to Audience and make sure your app is "External". If you need to switch it from "Internal" to "External", select the "In production" option in the popup.
You can then either publish your app, or add your email address as a test user. We will use the second method in this example
Go to the Clients menu then click the pencil to reveal your credentials
Copy your Client ID and Client secret then paste them in your AcyMailing configuration, then configure the connection to your mailbox.
The typical configuration for a connection with a Gmail account uses the following values:
Server: smtp.gmail.com
Port: 465
Secure method: SSL
Keep Alive: Yes
Authentication: Yes
Authentication method: Automatic
Connection type: With OAuth
Username: your email address
Client id: the Client ID you copied
Client secret: the Client secret key you copied
Once configured, save the configuration.
Click the Please log in button then select your Google account
If you opted for the test user method, Google will warn you that the app hasn't been verified yet. You can click the Continue button.
Finally, click the continue button to allow your app to connect to your email address
You should then be redirected to your website and a confirmation should be shown if everything worked correctly:
Here is the documentation to create a password: https://support.microsoft.com/en-us/account-billing/using-app-passwords-with-apps-that-don-t-support-two-step-verification-5896ed9b-4263-e681-128a-a6f2979a7944
Sign in to the Azure portal
Go to App registration
Click on "Registration an application" button
Fill name field
Choose the account you want to permit (more details here)
Fill your redirect url (Your redirect url is in your AcyMailing configuration)
Click on "create" button
Click on "Certificates & secrets" button
Click on "New client secret" button
Add a description (it's optional)
And click on "add" button
If you use OAuth for Bounce handling please:
Go to "API Permissions"
Click on "Add a permission"
Select "Microsoft Graph" and then search for "imap" you should be able to add the permission "IMAP.AccessAsUser.All"
Now, copy your secret id (it will not be visible afterwards)
Then, copy your client id
If you use Microsoft 365 account, please follow these steps to enable Oauth 2.0 :
go to your Microsoft 365 admin center
go to Settings > Org Settings > Modern Authentication
in the Modern authentication flyout that appears, click to enable or disable Turn on modern authentication for Outlook 2013 for Windows and later (recommended)
In your AcyMailing configuration, fill client id and client secret
Moreover please choose a tenant :
Microsoft accounts : select this tenant, if your application accept only personal accounts
Any account type : select this tenant, if your application accept both accounts (personal and organisations accounts)
Organisation : select this tenant, if your application accept only organisations accounts
And then click on "please log in" button
When you click on "log in" button, you will be redirected :
Connect your Outlook account and authorize access to your mailbox
Authorize AcyMailing to use your Outlook account to send your emails