Exchange Connection Problems

How to Debug Office 365 SMTP Connector 5.1.2 Error in Odoo

Phi Hung VoPhi Hung Vo Nov 2, 2026 869 views

Question details

User needs to resolve a 5.1.2 Unknown host error encountered while sending email from Odoo via an Office 365 Exchange connector.

How to Debug Office 365 SMTP Connector 5.1.2 Error in Odoo
Product
Office 365 Exchange / Odoo
Device & OS
not provided
Scenario
Configuring Odoo to send outbound mail using an Office 365 SMTP connector.
Observed behavior
Odoo returns a 5.1.2 Unknown host error for every recipient domain when attempting to dispatch emails.
Before you start

Verify whether your Odoo deployment is on-premises or Odoo Online. The Office 365 SMTP relay configuration requires a static public IP address, making it incompatible with Odoo Online.

Solution 1Recommended

Configure Authorized Office 365 SMTP Relay for On-Premises Odoo

Set up a properly authorized SMTP relay in Office 365 using your Odoo server's public IP address to resolve the 5.1.2 unknown host error.

To route mail successfully from an on-premises Odoo server through Office 365 without authentication errors, you must configure a connector in the Exchange Admin Center that authenticates your server via its static public IP address.

1
Identify your Server IP

Find and note the static public IP address of the machine hosting your on-premises Odoo server.

2
Create an Office 365 Connector

Log into the Office 365 Exchange admin center. Navigate to Mail flow > Connectors and add a new connector bridging your organization's email server to Office 365.

3
Authorize the IP Address

Within the connector settings, choose the option to identify your sending server by verifying its IP address. Enter the static public IP address of your Odoo server.

4
Verify DNS and Firewall Settings

Ensure your network firewall allows outbound traffic on port 25. Additionally, update your domain's SPF record in your DNS settings to include your Odoo server's public IP address to prevent outbound emails from being flagged as spam.

Configure Authorized Office 365 SMTP Relay for On-Premises Odoo
Odoo Online Compatibility: If you are using Odoo Online, you cannot use the Office 365 SMTP relay method. You will need to utilize standard SMTP client submission or a dedicated third-party transactional email service.
Free Microsoft Office alternative

Looking for a Lightweight Office Suite Alternative?

While resolving complex Exchange server and SMTP configurations, you might appreciate a simpler, hassle-free office suite for your document processing needs. WPS Office offers an easy-to-use, lightweight solution that perfectly handles standard document formats.

  1. 1. Download WPS Office: Visit the official WPS website and click the free download button for your operating system.
  2. 2. Install the Software: Run the downloaded installer and follow the simple on-screen instructions to complete the setup.
  3. 3. Open Your Documents: Launch WPS Office and instantly open, edit, or save your existing Microsoft Office files without any formatting loss.
Fully compatible with Microsoft Word, Excel, and PowerPoint formats (.docx, .xlsx, .pptx).Completely free to download for everyday document creation and editing.Lightweight design that installs quickly and consumes minimal system resources.Requires no complicated IT administration or server configurations.
microsoft office alternative - wps office

Frequently Asked Questions

Why do I get a 5.1.2 Unknown host error in Odoo when using Office 365?

This error typically occurs when Odoo attempts to send an email through an Office 365 connector that has not properly authenticated the sending server's IP address, or when there is a DNS resolution failure on the host network.

Can I use an Office 365 SMTP relay with Odoo Online?

No, the Office 365 SMTP relay configuration requires a static public IP address for authentication. Since Odoo Online environments share IP infrastructure, this specific setup is strictly limited to on-premises Odoo servers.

Which port should be open for an Office 365 SMTP relay connection?

When configuring an SMTP relay to Office 365, you generally need to use port 25. Ensure your network firewall and your Internet Service Provider allow outbound connections on this port.