Connecting Microsoft 365 to Odoo allows the ERP to send quotations, invoices, notifications and other business emails through an authorized Outlook mailbox. Odoo can also fetch messages from a shared mailbox and route them into CRM, Helpdesk, Projects or another supported business model.
The recommended approach is Microsoft Entra ID OAuth—not a mailbox password. OAuth provides token-based authorization and supports Microsoft's modern authentication direction.
This guide covers both outgoing and incoming email for Odoo 19. Menu names can vary slightly by database edition and installed applications.
Before you begin
You need:
- An Odoo administrator with access to Settings and Technical menus
- A Microsoft 365 account
- Permission to register an application in Microsoft Entra ID
- A mailbox such as
notifications@example.com,sales@example.comorsupport@example.com - Your final Odoo base URL
- Developer mode enabled in Odoo
For incoming email, use a shared operational mailbox rather than a private employee mailbox. Odoo warns that personal inboxes can introduce privacy and routing problems.
Part 1: Register Odoo in Microsoft Entra ID
Step 1: Create an application registration
- Sign in to the Microsoft Azure portal.
- Open Microsoft Entra ID.
- Go to App registrations.
- Select New registration.
- Enter a recognizable name such as
Odoo Microsoft 365 Mail. - Select the account type required by your organization. Odoo's current documentation specifies the multitenant and personal Microsoft account option for this integration.
- Under Redirect URI, choose Web.
- Enter:
https://<your-odoo-base-url>/microsoft_outlook/confirm
For SmartDesk's domain, the pattern would be:
https://www.smartdesksolution.com/microsoft_outlook/confirm
- Select Register.
The base URL must remain consistent. If users access Odoo through multiple domains, configure the correct canonical URL and add required redirect URIs deliberately.
Step 2: Add Microsoft Graph permissions
In the application registration:
- Open API permissions.
- Select Add a permission.
- Choose Microsoft Graph.
- Select Delegated permissions.
- Add:
SMTP.SendIMAP.AccessAsUser.All
- Confirm that
User.Readis present; Microsoft normally adds it by default. - Grant administrator consent if required by your Microsoft tenant policy.
Use only the permissions required for the integration.
Step 3: Assign permitted users
Open the enterprise application created from the registration and assign the Microsoft 365 users or groups that are allowed to authorize Odoo. If assignment is required but the mailbox user is not assigned, the OAuth connection can fail.
Step 4: Create the client secret
- Return to the app registration.
- Copy the Application (client) ID.
- Open Certificates & secrets.
- Select New client secret.
- Enter a description such as
Odoo Fetchmail. - Choose an appropriate expiration period.
- Create the secret.
- Copy the secret value immediately.
Microsoft displays the secret value only once. Store it in an approved password or secrets manager—not in email, a document, source code or a public task system. Record the expiry date because mail processing can stop when the secret expires.
Part 2: Configure Microsoft Outlook credentials in Odoo
Step 5: Install the Microsoft Outlook module
- Open Apps in Odoo.
- Remove the default Apps filter if necessary.
- Search for
Outlook. - Install Microsoft Outlook.
Step 6: Enable custom email servers
- Go to Settings → General Settings.
- Find the Emails section.
- Enable Use Custom Email Servers.
- Save.
- Enter the Microsoft Application ID and Client Secret Value under Outlook credentials.
- Save again.
Do not confuse the secret value with the secret ID. Odoo requires the secret value.
Part 3: Configure the outgoing Microsoft 365 mail server
Step 7: Create the outgoing server
- From the Email settings, open Outgoing Email Servers.
- Create a new server.
- Give it a clear name such as
Microsoft 365 – Notifications. - Enable or select Outlook authentication.
- Enter the Microsoft 365 mailbox username.
- Configure the From Filter.
For a single notification mailbox, an example is:
Username: notifications@example.com
From Filter: notifications@example.com
The From Filter is important. It determines which messages use this outgoing server and reduces sender-address mismatch errors.
Step 8: Authorize the Outlook account
- Select Connect your Outlook account.
- Sign in with the Microsoft mailbox being configured.
- Accept the requested permissions.
- Return to Odoo.
- Confirm that Odoo shows Outlook Token Valid.
- Select Test Connection.
Then send a real test from a non-production document to an internal address. Confirm the message arrives, the sender is correct and replies follow the expected route.
Part 4: Configure the incoming Microsoft 365 mail server
Step 9: Decide whether fetchmail is appropriate
Odoo recommends aliases or redirections for many normal inbound workflows. An Incoming Mail Server is most appropriate for a shared mailbox that must be fetched, such as support@, sales@ or jobs@.
Avoid connecting a personal executive or employee inbox. Incoming fetchmail can create records and route messages automatically, which creates privacy and operational risks when used with the wrong mailbox.
Step 10: Create the incoming server
- Enable developer mode.
- Go to Settings → Technical → Emails → Incoming Mail Servers.
- Create a new server.
- Enter a recognizable name.
- Select Outlook OAuth Authentication.
- Enter the Microsoft 365 mailbox username.
- Select Connect your Outlook account.
- Sign in and approve access.
- Confirm that Odoo displays a valid Outlook token.
- Select Test & Confirm.
Odoo's scheduled Mail: Fetchmail Service retrieves messages. IMAP is recommended over POP because it handles unread-message fetching more appropriately for this use case.
Step 11: Configure routing carefully
Depending on the Odoo configuration, incoming messages can create records in a selected model. Examples include:
sales@creating CRM leadssupport@creating Helpdesk ticketstask@creating project tasks
Test using an isolated mailbox and confirm:
- New messages create the intended record type.
- Replies attach to the correct existing record.
- Internal notifications do not create an email loop.
- Unauthorized senders cannot trigger sensitive automation.
- Attachments and access rights behave correctly.
Recommended system parameters for one notification mailbox
Odoo's documented single-server pattern uses:
Outgoing server username: notifications@example.com
Outgoing server From Filter: notifications@example.com
mail.catchall.domain: example.com
mail.default.from: notifications
Do not copy this example blindly. Match the values to your verified domain, alias design and reply-routing requirements.
DNS and deliverability checks
OAuth authenticates the mailbox, but successful delivery also depends on domain configuration. Verify:
- SPF includes the authorized Microsoft 365 sending infrastructure.
- DKIM signing is enabled for the domain in Microsoft 365.
- DMARC is published and monitored.
- The visible From address aligns with the authorized domain.
- Odoo is not switching unpredictably between multiple outgoing servers.
DNS mistakes can cause messages to reach spam or fail DMARC even when Odoo's connection test succeeds.
Common errors and fixes
Redirect URI mismatch
The URI in Microsoft Entra ID must exactly match Odoo's callback:
https://<your-odoo-base-url>/microsoft_outlook/confirm
Check the scheme, domain, subdomain, path and trailing characters.
Outlook token is invalid
Reconnect the account and verify the client ID, secret value, secret expiry, user assignment, tenant policy and API permissions.
Odoo can receive but cannot send
Confirm SMTP.Send, the outgoing-server From Filter, mailbox authorization and Microsoft tenant SMTP policy. Microsoft notes that SMTP AUTH settings and authentication policies can affect submission.
Odoo can send but cannot receive
Confirm IMAP.AccessAsUser.All, the incoming OAuth connection, mailbox assignment and the Mail: Fetchmail Service scheduled action.
Wrong outgoing server is selected
Review server priority and From Filters. Overlapping or empty filters can cause Odoo to choose an unintended server.
Messages create duplicates or loops
Review aliases, forwarding rules, catchall settings and automated actions. Do not forward a message back into the same route indefinitely.
Security checklist
- Use OAuth instead of basic mailbox passwords.
- Restrict the Entra application to required users.
- Grant only required delegated permissions.
- Store the client secret in a secrets manager.
- Track the secret expiration date.
- Use a shared operational mailbox for fetchmail.
- Test in a controlled environment.
- Review Odoo access rights for records created from email.
- Monitor failed mail queues and authentication errors.
Need help connecting Microsoft 365 to Odoo?
SmartDesk configures and troubleshoots Odoo outgoing mail, incoming mail, Microsoft Azure OAuth, aliases, routing and email deliverability for Saudi and international businesses.
Book a free Odoo health check or discuss an Odoo integration.
Sources
- Odoo 19: Connect Microsoft Outlook 365 using Azure OAuth
- Odoo 19: Manage inbound messages
- Microsoft: OAuth for IMAP, POP and SMTP
- Microsoft: SMTP AUTH in Exchange Online