Configure Outlook Email Server
https://www.odoo.com/documentation/18.0/applications/general/email_communication/azure_oauth.html
Register an App in Azure
- Go to Microsoft’s Azure Portal.
- Log in with the Microsoft Outlook Office 365 account with administrative rights.
- Navigate to the section labeled Manage Microsoft Entra ID.
- Click on Add (+), located in the top menu, and then select App registration.
- On the Register an application screen, rename the Name to Odoo or something recognizable.
- Under the Supported account types section select Accounts in any organizational directory (Any Microsoft Entra ID directory - Multitenant) and personal Microsoft accounts (e.g. Skype, Xbox).
- Under the Redirect URL section, select Web as the platform, and then input https://<web base url>/microsoft_outlook/confirm in the URL field. The web.base.url is subject to change depending on the URL used to log in to the database.
- After the URL has been added to the field, Register the application, so it is created.
Set API Permissions
- Click the API permissions link, located in the left menu bar under Manage.
- click on the (+) Add a Permission button and select Microsoft Graph under Commonly Used Microsoft APIs.
- Select the Delegated Permissions option.
- In the search bar, search for the following Delegated permissions and click Add permissions for each one:
SMTP.Send
IMAP.AccessAsUser.All
Assign users and groups
- Navigate back to the Overview of the Application in the top of the left sidebar menu.
- Now, add users to this application. Under the Essentials overview table, click on the link labeled Managed Application in Local Directory, or the last option on the bottom right-hand side of the table.
- In the left sidebar menu, select Users and Groups under Manage.
- Next, click on (+) Add User/Group. Depending on the account, either a Group and a User can be added, or only Users.
- Add the users/groups, click Select, and then Assign them to the application.
Create credentials
- Copy the Client ID from the Overview page of the app.
- Next, the Client Secret Value needs to be retrieved. To get this value, click on Certificates & Secrets in the left sidebar menu.
- Click on the (+) New Client Secret button.
- On the window on the right, under Description, type in Odoo Fetchmail or something recognizable, and then set the expiration date.
- Next, click on Add. A Client Secret Value and Secret ID values are now created.
- Save the created values.
Configure Outgoing Mailserver in Odoo:
- Activate the Developer Mode
- Enable Custom Email Servers and click Save.
- Copy and paste the Client ID (Application ID) and Client Secret (Client Secret Value) into the respective fields and Save the settings.
Configure Outgoing Mail Server:
- Go to Settings > Email > Outgoing Mail Servers and click Create.
- Name: Give your outgoing server a descriptive name. (Outlook Mail Server)
- FROM Filter: enter either a domain or email address.
- Authenticate With: Select "Outlook OAuth Authentication"
- SMTP Server: Enter smtp.outlook.com
- SMTP Port: Enter 587.
- Connection Encryption: Select "TLS (STARTTLS), encryption only".
- Username: Enter your full email address.
- Click Connect Your Outlook Account.
- A new window from Microsoft opens to complete the authorization process. Select the appropriate email address that is being configured in Odoo.
- Then, allow Odoo to access the Microsoft account by clicking on Yes
- After this, the page will navigate back to the newly configured Outgoing Mail Server in Odoo. The configuration automatically loads the token in Odoo, and a tag stating Outlook Token Valid appears in green.
- Finally, click Test Connection. A confirmation message should appear.
Enable SMTP Oauth in Microsoft 365:
If Outlook is registered via GoDaddy:
https://www.godaddy.com/help/enable-smtp-authentication-40981