How to Debug Office 365 SMTP Connector 5.1.2 Error in Odoo
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.

- 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.
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.
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.
Find and note the static public IP address of the machine hosting your on-premises Odoo server.
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.
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.
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.

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. Download WPS Office: Visit the official WPS website and click the free download button for your operating system.
- 2. Install the Software: Run the downloaded installer and follow the simple on-screen instructions to complete the setup.
- 3. Open Your Documents: Launch WPS Office and instantly open, edit, or save your existing Microsoft Office files without any formatting loss.

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.




