Post date: May 18, 2015 10:36:26 AM
When you set up a multifunction device or Line of Business (LOB) application to send email through Office 365, there are some cases where the device or application can’t connect directly to Office 365. In these cases, you need to set up Internet Information Services (IIS) to work as an intermediary. These instructions can be modified for other SMTP relays that you might have in your organization. We recommend reviewing the steps in the document How to Allow a Multi-function Device or Application to Send E-mail through Office 365 Using SMTP before proceeding with this procedure as there may be an available option that doesn’t require setting up an additional server to relay.
You might want to do this in the following scenarios:
You don’t have an on-premises messaging system any longer
You have line-of-business (LOB) programs or devices in an on-premises environment
Your LOB programs and devices have to send email messages to remote domains and to your Exchange Online mailboxes
What do you need to know before you begin?
Estimated time to complete: 15 minutes
Your on-premises domain must be added as an accepted domain in Office 365. For example, if the account you’re relaying from is bob@tailspintoys.com, you have to add tailspintoys.com as an accepted domain in Office 365.
Your on-premises account must also be either an Exchange Online-licensed user in Office 365 or an alternative email address of an Exchange Online-licensed user. For example, if the account that you’re relaying from is printer@tailspintoys.com and you want to relay through bob@contoso.com (an Office 365 user), you have to add printer@tailspintoys.com as an alternate email address to bob@contoso.com.
For information about keyboard shortcuts that may apply to the procedures in this topic, see Keyboard shortcuts in the Exchange admin center.
Tip:
Having problems? Ask for help in the Exchange forums. Visit the forums at: Exchange Server, Exchange Online, or Exchange Online Protection.
Use Server Manager to set up Exchange Online as an SMTP relay
The installation steps you’ll use are different for Windows Server 2012 and Windows Server 2008. Install Internet Information Services (IIS) on Windows Server 2012
Set up Exchange Online as an SMTP Relay Using Windows Server 2012
Install Internet Information Services (IIS)
In Server Manager, select Add Roles.
On the Before you begin page in the Add Roles Wizard, select Next.
On the Select Installation Type page, select Role-based or Feature-based installation.
On the Select destination server page, choose Select a server from the server pool, and select the server that will be running SMTP services. Select Next.
On the Select Server Roles page, select Web Server (IIS), and then select Next. If a page that requests additional features is displayed, select Add Features and then select Next.
On the Select Role Services page, make sure that Basic Authentication under Security is selected, and then select Next.
On the Confirm Installation Steps page, select Install.
Install SMTP
Open Server Manager and select Add Roles and Features.
Select Server Selection and make sure that the server that will be running the SMTP server is selected and then select Features.
On the Select Features screen, choose SMTP Server. You may be prompted to install additional components. If that’s the case, select Add Required Features and select Next.
Select Install. After the installation is finished, you may have to start the SMTP service by using the Services snap-in for the Microsoft Management Console (MMC).
Set up SMTP
Open Server Manager, select Tools, and then select Internet Information Services (IIS) 6.0.
Expand the current server, right-click the SMTP Virtual Server, and then select Properties.
On the General tab, select Advanced > Add.
In the IP Address box, specify the address of the server that’s hosting the SMTP server.
In the Port box, enter 587 and select OK.
On the Access tab, do the following:
Select Authentication and make sure that Anonymous Access is selected.
Select Connection > Only the List Below, and then specify the IP addresses of the devices that will be connecting to the SMTP server, such as printers.
Select Relay > Only the List Below, and then specify the IP address of the devices relaying through this SMTP server
On the Delivery tab, select Outbound Security, and then do the following:
Select Basic Authentication.
Enter the credentials of the Office 365 user who you want to use to relay SMTP mail.
Select TLS Encryption.
Select Outbound Connections, and in the TCP Port box, enter 587 and select OK.
Select Advanced and specify SMTP.office365.com as the Smart Host.
Restart the IIS service and the SMTP service.
Set up Exchange Online as an SMTP Relay Using Windows Server 2008
Install Internet Information Services (IIS)
In Server Manager, select Add Roles.
On the Before you begin page in the Add Roles Wizard, select Next.
On the Select Server Roles page, select Web Server (IIS) and select Install.
Select Next until you get to the Select Role Services page.
In addition to what is already selected, make sure that ODBC Logging, IIS Metabase Compatibility, and IIS 6 Management Console are selected and then select Next.
When you’re prompted to install IIS, select Install. You may need to restart the server after the installation is finished.
Install SMTP
Open Server Manager and select Add Roles and Features.
On the Select Features screen, choose SMTP Server. You may be prompted to install additional components. If that’s the case, select Add Required Features and select Next.
Select Install. After the installation is finished, you may have to start the SMTP service by using the Services snap-in for the Microsoft Management Console (MMC).
Set up SMTP
Select Start > Administrative Tools > Internet Information Services (IIS) 6.0.
Expand the current server, right-click the SMTP Virtual Server, and then select Properties.
On the General tab, select Advanced > Add.
In the IP Address box, specify the address of the server that’s hosting the SMTP server.
In the Port box, enter 587 and select OK.
On the Access tab, do the following:
Select Authentication and make sure that Anonymous Access is selected.
Select Connection > Only the List Below, and then specify the IP addresses of the devices that will be connecting to the SMTP server, such as printers.
Select Relay > Only the List Below, and then specify the IP address of the devices relaying through this SMTP server
On the Delivery tab, select Outbound Security, and then do the following:
Select Basic Authentication.
Enter the credentials of the Office 365 user who you want to use to relay SMTP mail.
Select TLS Encryption.
Select Outbound Connections and in the TCP Port box, enter 587 and select OK.
Select Advanced and specify SMTP.office365.com as the Smart Host.
Restart the IIS service and the SMTP service.
You can test SMTP relay services without using an separate LOB application or device.
To test SMTP relay services, use the following steps.
Create a text file using Notepad or another text editor. The file should contain the following code. Replace the source and destination email addresses with the addresses you will use to relay SMTP.
FROM: <source email address> TO: <destination email address> SUBJECT: Test email This is a test email sent from my SMTP server
Save the text file as Email.txt.
Copy the Email.txt file into the following folder: C:\InetPub\MailRoot\Pickup.
After a short time, the file should automatically be moved to the C:\InetPub\MailRoot\Queue folder. When the SMTP server delivers the mail, the file is automatically deleted from the local folder.
Warning:
If the SMTP server can’t deliver the message, a non-delivery report (NDR) is created in the C:\InetPub\MailRoot\BadMail folder. You can use this NDR to diagnose delivery issues.