Skip to main content
Question

Is it possible to read emails with FME Desktop? We use Outlook (Exchange).

  • June 15, 2018
  • 4 replies
  • 393 views

Forum|alt.badge.img

I have an email in Outlook (Exchange) and hope that it is possible to read the emails with FME Desktop.

Does anyone now how to do that?

Regards,

Morten Friis

This post is closed to further activity.
It may be an old question, an answered question, an implemented idea, or a notification-only post.
Please check post dates before relying on any information in a question or answer.
For follow-up or related questions, please post a new question or idea.
If there is a genuine update to be made, please contact us and request that the post is reopened.

4 replies

david_r
Celebrity
  • June 18, 2018

As far as I know there is no such native capability in FME Desktop, but I'm confident it should be doable without too much effort:

Feel free to ask again here if you get stuck somwhere.


bhanu_v
Forum|alt.badge.img
  • February 19, 2019

Hello @ikast_mofri,

Im looking to accomplish the exact same thing .

Have you had any luck figuring this out ?


davtorgh
Contributor
Forum|alt.badge.img+12
  • Contributor
  • August 13, 2025

HI,

has anyone tried the method described by ​@david_r and possibly can share an example?

Thanks!


david_r
Celebrity
  • August 13, 2025

I’m not sure if you can still use POP, especially on Exchange for Office 365. You can try to using the MS Graph API, which is what Microsoft recommends. Here’s an example in Python:

import requests
from msal import ConfidentialClientApplication # You'll need to install "msal" first

# App registration details from Azure AD
client_id = 'your_client_id'
client_secret = 'your_client_secret'
tenant_id = 'your_tenant_id'

# Create MSAL app
app = ConfidentialClientApplication(
client_id,
authority=f"https://login.microsoftonline.com/{tenant_id}",
client_credential=client_secret
)

# Get token
scope = ['https://graph.microsoft.com/.default']
result = app.acquire_token_for_client(scopes=scope)
access_token = result['access_token']

# Read emails
headers = {
'Authorization': f'Bearer {access_token}',
'Content-Type': 'application/json'
}

# Get messages from a specific user's mailbox
user_email = 'user@domain.com'
endpoint = f'https://graph.microsoft.com/v1.0/users/{user_email}/messages'

# Optional: Add filters and select specific fields
params = {
'$filter': "receivedDateTime ge 2024-01-01",
'$select': 'subject,from,receivedDateTime,body',
'$top': 10,
'$orderby': 'receivedDateTime desc'
}

response = requests.get(endpoint, headers=headers, params=params)
messages = response.json()

for message in messages.get('value', []):
print(f"Subject: {message['subject']}")
print(f"From: {message['from']['emailAddress']['address']}")
print(f"Date: {message['receivedDateTime']}")
print("-" * 50)

Since FME has its own FME service defintion for the Graph API, you should even be able to use it using HTTPCallers, if Python is not your thing: https://hub.safe.com/publishers/safe-lab/web-connections/microsoft-graph