Skip to main content
Question

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


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

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+11
  • 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

 


Cookie policy

We use cookies to enhance and personalize your experience. If you accept you agree to our full cookie policy. Learn more about our cookies.

 
Cookie settings