Gray Wolf Corporation

IIS SMTP Relay through Office 365

I recently helped a client move from on-prem Exchange 2007 to Exchange Online.

One of the challenges was enabling smtp relay for in-house applications that had been sending email through the on-prem server.

There are two steps:

  • configure and enable a connector in Exchange Online
  • configure IIS 6 SMTP service on a local server.

Exchange Online

From Exchange Admin / Mail Flow / Connectors - add new connector

  • From: Your organization email server
  • To: Office 365

relay1

Give the connector a name and continue.

There are two ways to identify your local email server to Office 365: Certificate or IP address. IP address is simpler, otherwise you will need to install your ssl cert on the same machine that the IIS 6 SMTP server will reside.

relay2

Save your connector.

IIS 6 SMTP service

Enable smtp on a server where IIS is configured. Be sure to also include the IIS 6 Admin console. After the smtp server has been configured, right click on the SMTP Virtual Server #1, Properties, Delivery, Advanced.

relay3

This is where we will tell IIS where to direct the outgoing mail.

The fully qualified domain name should be the domain you have configured in Office 365: i.e contoso.com

The smart host is the domain that is configured in Office 365 for your mail. Using contoso.com as an example, the smart host value would be: contoso-com.mail.protection.outlook.com

Under Outbound Security, make sure that TLS encryption is checked. This will allow any of your applications that do not implenet TLS to relay through IIS. Exchange online requires TLS to allow the connection.

relay4

At this point, you should be good to go to start relaying through IIS. You can enable detailed logging in IIS, if more smtp detail is needed.

An unhandled error has occurred. Reload 🗙