📄 Configure Outlook Email Server

Configure Outlook Email Server

https://www.odoo.com/documentation/18.0/applications/general/email_communication/azure_oauth.html

Register an App in Azure

  1. Go to  Microsoft’s Azure Portal.
  2. Log in with the Microsoft Outlook Office 365 account with administrative rights.
  3. Navigate to the section labeled Manage Microsoft Entra ID.
  4. Click on Add (+), located in the top menu, and then select App registration.
  5. On the Register an application screen, rename the Name to Odoo or something recognizable. 
  6. 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).
  7. 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.
  8. After the URL has been added to the field, Register the application, so it is created.

Set API Permissions

  1. Click the API permissions link, located in the left menu bar under Manage.
  2. click on the (+) Add a Permission button and select Microsoft Graph under Commonly Used Microsoft APIs.
  3. Select the Delegated Permissions option.
    1. In the search bar, search for the following Delegated permissions and click Add permissions for each one:
      1. SMTP.Send

      2. IMAP.AccessAsUser.All

Assign users and groups

  1. Navigate back to the Overview of the Application in the top of the left sidebar menu.
  2. 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.
  3. In the left sidebar menu, select Users and Groups under Manage.
  4. Next, click on (+) Add User/Group. Depending on the account, either a Group and a User can be added, or only Users.
  5. Add the users/groups, click Select, and then Assign them to the application.

Create credentials

  1. Copy the Client ID from the Overview page of the app.


  2. Next, the Client Secret Value needs to be retrieved. To get this value, click on Certificates & Secrets in the left sidebar menu.
  3. Click on the (+) New Client Secret button.
  4. On the window on the right, under Description, type in Odoo Fetchmail or something recognizable, and then set the expiration date.
  5. Next, click on Add. A Client Secret Value and Secret ID values are now created.
  6. Save the created values.

Configure Outgoing Mailserver in Odoo:

  1. Activate the Developer Mode
  2. Enable Custom Email Servers and click Save.
  3. 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:

  1. Go to Settings > Email > Outgoing Mail Servers and click Create.
  2. Name: Give your outgoing server a descriptive name. (Outlook Mail Server)
  3. FROM Filter: enter either a domain or email address.
  4. Authenticate With: Select "Outlook OAuth Authentication"
  5. SMTP Server: Enter smtp.outlook.com
  6. SMTP Port: Enter 587.
  7. Connection Encryption: Select "TLS (STARTTLS), encryption only".
  8. Username: Enter your full email address.
  9. Click Connect Your Outlook Account
  10. A new window from Microsoft opens to complete the authorization process. Select the appropriate email address that is being configured in Odoo.
  11. Then, allow Odoo to access the Microsoft account by clicking on Yes
  12. 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.
  13. Finally, click Test Connection. A confirmation message should appear.

Enable SMTP  Oauth in Microsoft 365:

https://learn.microsoft.com/en-us/exchange/clients-and-mobile-in-exchange-online/authenticated-client-smtp-submission

If Outlook is registered via GoDaddy:

https://www.godaddy.com/help/enable-smtp-authentication-40981