Introduction
This article explains how to connect FME to Microsoft Exchange Online using OAuth 2.0 to send and receive email. Microsoft calls OAuth 2.0 "Modern Authentication". Microsoft blocked basic authentication for the IMAP and SMTP protocols in January 2023. For more information, see the Microsoft blog post Basic Authentication Deprecation in Exchange Online.
For sending email, FME supports the SMTP email protocol through the Emailer transformer, the Automation External Email Action, and the legacy Notification Service Email Subscriber.
For monitoring incoming email, FME Flow supports the IMAP email protocol in the Automation IMAP Email Trigger and the legacy Notification Service Email Publisher.
Requirements
- FME 2022.2+
- Access to the Microsoft Azure Portal and permission to create an app registration
- For sending email only: SMTP AUTH for the organization and SMTP AUTH for the specific mailboxes must be enabled. Enable them in the Exchange Admin Center and the Microsoft 365 Admin Center, respectively. The SMTP AUTH protocol is used for SMTP client email submissions.
Step-by-Step Instructions
Part 1: Emailer Transformer in FME Form (SMTP)
In this part, you create an Azure app registration, a web service, and a web connection in FME Form. Then you use the web connection in the Emailer transformer.
1. Create an Azure App Registration
Create an Azure app registration as described in the Microsoft documentation.
The app registration Overview contains information you need later to configure the web service in FME. The screenshots in this article use a multitenant app registration as an example.
2. Configure the Azure App Registration for FME Form
After you create the app registration, add a platform for Mobile and desktop applications.
When you add the platform, use the Microsoft default redirect URI for desktop applications: https://login.microsoftonline.com/common/oauth2/nativeclient. This URI must match the web service in FME Form, which you create in the next step. If you registered a single tenant app, the redirect URI is https://login.microsoftonline.com/<TenantID>/oauth2/nativeclient.
FME Form 2025.2+ moves away from the embedded browser authentication used
in this article. Instead, add one of the following Redirect URIs to the app
registration in Azure. Then set the matching Redirect Strategy parameter
on the FME web service (in Part 1: Step 3 below).
• Loopback Interface Redirect: http://localhost
• Proxy Redirect (Safe Software):
https://fmeauth.safe.com/v1/oauth2
The embedded browser is planned for full removal in FME Form 2026.2, so make
this change before that release. See
External Browser Authentication in FME Form
for details on the Redirect Strategy parameter and migration steps.
In API Permissions, add the following Microsoft Graph Delegated Permissions. For help, see the Microsoft documentation.
- offline_access
- User.Read
- Mail.Send
3. Create the Web Service in FME Form
The Emailer transformer includes a Microsoft Mail (safe.emailer) web service template. If the Emailer package is not installed, add the Emailer to the FME Workbench canvas, or download it from the FME Hub.
To create a web service from the template, go to Tools > FME Options > Web Connections > Manage Services… (on macOS, go to FME Workbench > Preferences > Web Connections > Manage Services…). In the Manage Web Services dialog, click + > Create From > Microsoft Mail (safe.emailer).
In the new web service, set the following:
- Web Service Name: Include the name of the Azure app registration for reference.
- Client ID: The Client ID from the Azure app registration. It is on the Overview page of the app registration.
- Optional: Enabled. Leave Client Secret empty. The client secret is only for FME Flow. A client secret in FME Form returns errors from Microsoft Azure.
-
For Multitenant Azure App Registrations: Leave the Redirect URI as
https://login.microsoftonline.com/common/oauth2/nativeclientto match the Azure app registration. -
For Single Tenant Azure App Registrations: In the Redirect URI, Parameters URL, Retrieve Token Parameters URL, and Refresh Token Parameters URL, replace
commonwith the Tenant ID. The Tenant ID is on the Overview page of the app registration. -
Refresh Token Parameters URL: Confirm that the URL does not contain the hardcoded parameter and value
&redirect_uri=http://localhost/. Alternatively, addhttp://localhostto the desktop redirect URI list in the app registration.
Click Test to test the web service connection. When prompted, enter the Microsoft credentials and consent to the application permissions in the Azure tenant. Click Apply.
Your Azure administrator may restrict user consent for applications. If you receive a Needs Admin Approval message when you authorize the connection, authorize with an admin account. Alternatively, your Azure admin can change the user consent settings in Microsoft Azure.
4. Create the Web Connection in FME Form
Return to the Web Connections dialog (Tools > FME Options > Web Connections > Manage Services…; on macOS, FME Workbench > Preferences > Web Connections > Manage Services…). Click + to add a web connection. Click the web service you created and enter a name for the connection. Click OK. When prompted, enter the Microsoft credentials to authorize the connection.
5. Use the Web Connection in the Emailer
The new Microsoft Mail web connection is ready to use in the Emailer transformer. The rest of the configuration is the same as for basic authentication.
If you encounter errors, see Troubleshooting.
Part 2: Emailer Transformer in FME Flow (SMTP)
To use the Emailer transformer with Microsoft as the email service on FME Flow, follow the steps below.
1. Complete Part 1
Complete the steps in Part 1: Emailer Transformer in FME Form (SMTP).
2. Add the FME Flow Redirect URI to the Azure App Registration
In the Microsoft Azure app registration, go to Authentication > Add a platform and add a second platform for Web. Enter the Redirect URI in the following format:
HTTPS://<Your FME Flow URL>/fmeoauth
3. Create a Client Secret
A client secret is required to use the Emailer on FME Flow. In the app registration, click Certificates & Secrets > + New client secret.
The client secret value is visible only right after you create it. After that, it is hidden. Store the value immediately in a secure place, such as a secrets vault. Client secrets expire. Set a reminder before the expiry date so that you can generate a new client secret and update the web service in FME Flow. Workspaces that use this web service stop working after the secret expires.
For more information about client secrets, see the Microsoft documentation.
4. Publish to FME Flow
Publish a workspace that uses the Emailer and the Microsoft Mail web connection to FME Flow. Alternatively, upload the web connection from FME Form. Go to Tools > FME Options > Web Connections > (right-click) Upload.
5. Edit the Web Service in FME Flow
In FME Flow, go to Connections & Parameters > Web Connections > Manage Web Services. Click the name of the web service that you created in Part 1. Confirm that the Client ID matches the Azure app registration from Part 1. Add the Client Secret and the Redirect URI that you added to the Azure app registration earlier in this part. Click Save.
6. Authorize the Web Connection
Go to Connections & Parameters > Web Connections and click the web connection name. Click Authorize. Enter the Microsoft credentials. After authorization, the web connection shows a green check mark.
7. Test the Web Connection
Run a workspace with an Emailer transformer that uses the Microsoft Mail web connection.
If you encounter errors, see Troubleshooting.
Part 3: FME Flow Automations
An email sent to a Microsoft Exchange Online inbox can trigger an Automation (IMAP). An Automation can also send email with the Email external action and Microsoft Exchange Online (SMTP). Before you start, note the following.
The Microsoft account must have multifactor authentication (MFA) disabled. If this is a problem, use the Emailer transformer instead. Unlike the Emailer, the trigger and action do not use a web service, but they still need a Microsoft Azure app registration. A client secret is not required.
1. Create an Azure App Registration
Create an Azure app registration. If needed, see Part 1: Emailer Transformer in FME Form (SMTP) or the Microsoft documentation. You can use the same app registration if you already created one for the Emailer transformer.
In the Microsoft Azure app registration, select the correct platform for
the Redirect URI. For FME Flow integrations, go to Authentication > Add
a platform, add a second platform for Web, and enter the Redirect URI in
the following format:
HTTPS://<Your FME Flow URL>/fmeoauth
2. Add Permissions to the App Registration
In API Permissions, add the following Microsoft Graph Delegated Permissions. For help, see the Microsoft documentation.
- IMAP.AccessAsUser.All
- SMTP.Send
Grant admin consent after you add the permissions. This allows FME Flow to perform operations on behalf of the signed-in user.
3. Allow Public Client Flows
In Authentication, allow the app registration to function as a public client by allowing public client flows.
4. Configure the Automation
The Email - IMAP (received) trigger and the Email (send) external action have an additional Client ID field. Enter the Client ID from the Azure app registration that you created in step 1. As mentioned earlier, you do not need a client secret.
The rest of the configuration is the same as for basic authentication with an email address and password. You can use any user who is registered under the application for the Email Account and Email Password fields in the Automation. To find the registered users, go to Enterprise applications > [application name] > Manage > Users and groups. To add users or groups to the application, click Add user/group, as shown in the screenshot below.
This step is the same if you use the legacy Notification Service. Use the SMTP Email Subscriber to send email, or the IMAP Email Publisher to receive email.
Troubleshooting
Inspect the Microsoft Entra Sign-In logs for sign-in attempts that FME makes to the Azure Entra tenant. For more help, see the troubleshooting articles in Additional Resources.
Additional Resources
- FME Form Troubleshooting: Web Services and Connections [Article]
- FME Flow Troubleshooting: Web Connections [Article]
- FME Flow Troubleshooting: Email [Article]