Objective
We have a printer here which can send email via SMTP. However, Office 365 is quite finnicky on the configuration.
This article is extracted from How to set up a multifunction device or application to send email using Microsoft 365 or Office 365 | Microsoft Docs
What do we need?
We’ll need FIXED-IP for on-prem devices
Email address
We’ll need email address for the sender. However, we do not need to get mailbox for this user.
In our example, we are using [email protected]
MX Record
- Login to Microsoft 365 admin center
- Go to Settings > Domains, select your domain (for example, contoso.com), and find the MX record
Note down this MX Record, we’ll need this to configure SMTP server
Connector
- Go to Exchange admin center > Mail Flow > Connectors
- Add a connector
- From Your Organization’s email server to Office 365
- Name is not really config-breaking. We can put easily identifiable name and write some description for notes.
- Next. we’ll use verify IP address. This is the reason why we’ll need fixed IP address
Update SPF record
- Go to your domain registrar’s control panel (e.g. cpanel)
- Edit SPF record (TXT type) to include on-prem IP address to something like the following
v=spf1 ip4:10.5.4.3 include:spf.protection.outlook.com -all
Device Config
On the device (e.g. printer), here are the configuration
| Key | Value |
| Server | MX record obtained from section above |
| Port | 25 |
| StartTLS | Enabled |
| Email address | The email address prepared on section above |
Remember to open TCP Port 25 outgoing in your firewall
You may need to turn on latest TLS (i.e. TLS 1.2) and HASH standard (SHA256)