User Guide: Allowing Odoo to send email via Microsoft 365

Last updated: 25 September 2023 at 16:43:21 UTC by Junari Assistant

Microsoft now requires a special configuration in order to allow external applications such as Odoo to send and receive emails through Microsoft 365.


There are two parts to getting this set up:

  1. Use the Microsoft 365 Admin Centre to create an "App Registration", and obtain a "Client ID" and "Secret" which will then be entered into Odoo.

  2. Install an outlook specific app in Odoo to allow it to connect to Microsoft 365 using the new authentication method


Information Required


You'll need the following information (provided by Junari support) to be able to complete the below steps:


  • Your Odoo system address (e.g. https://mycompany.odoo.com)


1. Configuration of Microsoft 365


You must have Microsoft 365 Administrator rights to complete the below steps


  • Log in to your Microsoft Azure Active Directory account

  • Go to the App Registrations area

  • Create a new app registration





  • Fill in the details as per the below screenshot

  • For the Redirect URI, enter your odoo system URL, with "/microsoft_outlook/confirm" on the end of it,

    e.g. https://mycompany.odoo.com/microsoft_outlook/confirm





  • Click the Certificates & Secrets menu on the left-hand side of your newly created app.

  • Click the New Client Secret button to generate a Client Secret. Set the expiry date to 24 months (the maximum)

  • Once generated, click the Copy button to copy the Client Secret value (as shown below) and paste it into e.g. Notepad





  • Back on the application overview, copy the Client ID as shown below and paste that into Notepad as well





  • We now need to give this new app certain permissions. Please follow the steps below:

    • On your app, click Click API Permissions -> Add a permission

    • Select Microsoft Graph and then Delegated Permissions

    • Add the following permissions:

      • SMTP.Send

      • IMAP.AccessAsUser.All




Grant the "Odoo" Email user access to the app


We now need to give the odoo@yourdomain.com user access to the app


Click the Managed application in local directory option on the app overview page




Click Users + groups




Click Add, and search for the odoo@ email user (or whatever user you have configured for email access)




Add the  odoo@ user to the list of users




Make sure you click the Assign button to confirm the assignment.


Now please provide Junari with the following information:

  • App Client ID

  • App Client Secret

  • The email address of the user that you have given access to the app



2. Odoo Configuration


This will generally be done by Junari, or someone else with "Settings" rights on the odoo system


First, install the microsoft_outlook and fetchmail_outlook Odoo modules




Then go into General Settings and fill in the Outlook Credentials using the Client ID and Client Secret gathered above




Now we can configure the email server. Enable developer mode and add/update an incoming email server.


Tick the "Outlook" checkbox, then click the "Connect your Outlook Account" option




Log in and accept the permissions request