Skip to Content

How to Connect Microsoft 365 Incoming and Outgoing Mail Servers to Odoo 19

Configure Microsoft 365 outgoing SMTP and incoming IMAP securely in Odoo 19 through Microsoft Entra ID OAuth.
August 28, 2026 by
Smart Desk Solution

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.com or support@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

  1. Sign in to the Microsoft Azure portal.
  2. Open Microsoft Entra ID.
  3. Go to App registrations.
  4. Select New registration.
  5. Enter a recognizable name such as Odoo Microsoft 365 Mail.
  6. Select the account type required by your organization. Odoo's current documentation specifies the multitenant and personal Microsoft account option for this integration.
  7. Under Redirect URI, choose Web.
  8. Enter:
https://<your-odoo-base-url>/microsoft_outlook/confirm

For SmartDesk's domain, the pattern would be:

https://www.smartdesksolution.com/microsoft_outlook/confirm
  1. 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:

  1. Open API permissions.
  2. Select Add a permission.
  3. Choose Microsoft Graph.
  4. Select Delegated permissions.
  5. Add:
  • SMTP.Send
  • IMAP.AccessAsUser.All
  1. Confirm that User.Read is present; Microsoft normally adds it by default.
  2. 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

  1. Return to the app registration.
  2. Copy the Application (client) ID.
  3. Open Certificates & secrets.
  4. Select New client secret.
  5. Enter a description such as Odoo Fetchmail.
  6. Choose an appropriate expiration period.
  7. Create the secret.
  8. 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

  1. Open Apps in Odoo.
  2. Remove the default Apps filter if necessary.
  3. Search for Outlook.
  4. Install Microsoft Outlook.

Step 6: Enable custom email servers

  1. Go to Settings → General Settings.
  2. Find the Emails section.
  3. Enable Use Custom Email Servers.
  4. Save.
  5. Enter the Microsoft Application ID and Client Secret Value under Outlook credentials.
  6. 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

  1. From the Email settings, open Outgoing Email Servers.
  2. Create a new server.
  3. Give it a clear name such as Microsoft 365 – Notifications.
  4. Enable or select Outlook authentication.
  5. Enter the Microsoft 365 mailbox username.
  6. 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

  1. Select Connect your Outlook account.
  2. Sign in with the Microsoft mailbox being configured.
  3. Accept the requested permissions.
  4. Return to Odoo.
  5. Confirm that Odoo shows Outlook Token Valid.
  6. 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

  1. Enable developer mode.
  2. Go to Settings → Technical → Emails → Incoming Mail Servers.
  3. Create a new server.
  4. Enter a recognizable name.
  5. Select Outlook OAuth Authentication.
  6. Enter the Microsoft 365 mailbox username.
  7. Select Connect your Outlook account.
  8. Sign in and approve access.
  9. Confirm that Odoo displays a valid Outlook token.
  10. 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 leads
  • support@ creating Helpdesk tickets
  • task@ 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

Need practical Odoo support? Book a free Odoo health check.
Odoo 20 Features: What Is Confirmed and How to Prepare for the Upgrade
A fact-checked Odoo 20 preview covering confirmed information, evaluation priorities and a practical upgrade-readiness checklist.