It has become increasingly challenging to send emails from devices and application servers because many SMTP servers now require the use of OAuth 2.0, which legacy devices and applications cannot support. To bridge this gap, you can use Xeams. This page provides information on how to configure your devices and application servers to send emails to Xeams, which will then deliver those messages through your Exchange Online account.
Microsoft offers multiple methods for relaying messages from MFP devices or on-premises application servers. These methods are described in detail on How to set up a multifunction device or application to send email using Microsoft 365 or Office 365.
This is the first part of a three-part series that compares the different methods Microsoft uses to accept emails from your on-premise SMTP server. The remainder of this page talks about Authenticate an SMTP connection using OAuth
Consider the following scenario:
Recent policy changes in Microsoft requires you to use OAuth 2.0, which is a more secure mechanism to authenticate users. As a result, legacy devices and application servers are unable to send emails.
Use the following solution to route such emails:
The following diagram shows the flow.
You must complete the following tasks before proceeding:
Most devices and application servers accept values for SMTP servers when they need to send outbound emails. If your device and Xeams are running on the same network, you can use the local IP address or hostname of the machine running Xeams for the SMTP server.
If needed, you can create users in Xeams and then specify those users for SMTP Authentication. Alternatively, you can allow certain IP addresses in Xeams to relay.
You must configure the Smart Host (under Server Configuration) to route messages through Exchange Online.
When using OAuth, an app is needed on https://portal.azure.com with proper permissions, scopes, and APIs. Xeams offers two options when using OAuth with Microsoft:
Select the desired tab below for further details.
Use this option if you want to register an app yourself. During configuration, you will be prompted for the following parameters:
The remainder of this document talks about steps you need to take to get the values for these parameters.
The User ID above refers to any valid user in your company, with an email that is hosted on Exchange Online. Values for the remaining two configuration parameters mentioned above are obtained by registering an app in Azure. The following section discusses step-by-step instructions on how to achieve this goal.
http://localhost/auth for Redirect URI. We will add/modify this value later on.The value for the Client ID field is displayed on the page after you register the app. Refer to the image below.



https://outlook.office.com/SMTP.send offline_access for the Scope field.
To facilitate OAuth, Synametrics Technologies, Inc. has regsitered an app with Microsoft with proper permissions.
Once completed, you will be able to send emails through Exchange online.
Microsoft's policy restricts you from specifying any email address but the one you put for the User ID field in Xeams.
No further action is required if you're okay with this limitation. However, if you need to send emails from other senders in your organization, you must configure Send As permission for that user. Follow instructions on this page for details.
You will receive the following error if this permission is not granted.
554 5.2.252 SendAsDenied; john.doe@yourcompany.onmicrosoft.com not allowed to send as janedoe@yourcompany.com; STOREDRV.Submission.Exception:SendAsDeniedException.MapiExceptionSendAsDenied; Failed to process message due to a permanent exception with message...
Microsoft's policies require that, when using authentication, the sender of the email (as shown in the From field of your email) must be a valid user. Consider the following email as an example:
From: hp_printer@yourcompany.com To: john.doe@yourcompany.com Subject: Scanned PDFIn this case,
hp_printer@yourcompany.com must be a valid user. Microsoft will
reject the message if you send an email from a user who does not exist.
If you wish to send emails from invalid users, such as "no-reply@yourcompany.com", "alerts@yourcompany.com", "server-status@yourcompany.com", etc, you
must use other methods specified on this page.