What are the API options for retrieving full EML in an Outlook Add-in in mobile?

Doug Goldstein 20 Reputation points
2025-11-17T01:59:43.21+00:00

We are building an Outlook add-in which processes the full EML of the selected email. We have it working in Outlook web app and Outlook desktop app, however in the mobile app the add-in is failing because the necessary APIs are not supported in mobile (we have tested in iOS). Office.context.mailbox.item.getAsFileAsync API does not work on mobile (mobile only supports API set up to and including Mailbox 1.5, getAsFileAsync is 1.14). Using the Graph API we need to get the access token to do the backend OBO flow, but both OfficeRuntime.auth.getAccessToken and Office.auth.getAccessToken don't work on mobile (we tested and got the error: API is not supported in this platform). Is there any supported API or workaround today that allows an Outlook Mobile Add-in to retrieve the full MIME/EML content of an email?

Microsoft 365 and Office | Development | Office JavaScript API
0 comments No comments
{count} votes

Answer accepted by question author
  1. Teddie-D 8,875 Reputation points Microsoft External Staff Moderator
    2025-11-17T04:07:26.42+00:00

    Hi @Doug Goldstein 

    Thank you for posting your question in the Microsoft Q&A forum. 

    Outlook mobile add‑ins cannot directly retrieve the full MIME/EML content of the selected message.

    Here is a workaround that you may try: 

    1.From the Outlook mobile Add‑in (Office.js) 

    Outlook Mobile supports Mailbox 1.1, which means you can read the Internet Message ID directly. 

    const internetMessageId = Office.context.mailbox.item.internetMessageId; 
    

    Send this internetMessageId to your backend, along with a user identifier (like their UPN or internal user ID). 

    2.On your backend  

    Outlook Mobile doesn’t support APIs for SSO or direct message retrieval, so the backend must use application permissions to access the mailbox. 

    Locate the email by its Internet Message ID: 

    -Exact match with $filter

    GET https://graph.microsoft.com/v1.0/users/{userId}/messages?$filter=internetMessageId eq '{internetMessageId}' 
    

    Note: Internet Message IDs contain reserved characters like < and >. You must URL‑encode them when using $filter.
    For example:

    • Internet Message ID: <******@contoso.com>
    • Encoded: %3C******@contoso.com%3E 

    -Fallback if $filter doesn't find it, use $search

    GET https://graph.microsoft.com/v1.0/users/{userId}/messages?$search="{internetMessageId}" 
    

    3.Once you’ve located the message and have its Graph ID, download the complete MIME/EML content: 

    GET https://graph.microsoft.com/v1.0/users/{userId}/messages/{messageId}/$value 
    

    This returns the full RFC 822 MIME content. You can save it directly as an .eml file or process it however your service requires. 

    You can read more at Get MIME content of a message using the Outlook mail API - Microsoft Graph | Microsoft Learn.

    I hope this helps. 


    If the answer is helpful, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".   

    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread

    1 person found this answer helpful.

1 additional answer

Sort by: Most helpful
  1. Q&A Assist
    2025-11-17T01:59:55.2266667+00:00
    AI generated content. This question contains an answer created with AI from Q&A Assist. Learn more

    Currently, Outlook mobile supports APIs up to Mailbox requirement set 1.5. Unfortunately, the Office.context.mailbox.item.getAsFileAsync API, which is necessary for retrieving the full EML of an email, is part of requirement set 1.14 and is not supported on mobile devices. Additionally, the methods for obtaining access tokens, such as OfficeRuntime.auth.getAccessToken and Office.auth.getAccessToken, are also not supported on mobile platforms.

    As of now, there are no supported APIs or workarounds available that would allow an Outlook Mobile Add-in to retrieve the full MIME/EML content of an email. You may need to consider alternative approaches or wait for future updates that might expand the API capabilities on mobile.


    References:

    0 comments No comments

Your answer

Answers can be marked as 'Accepted' by the question author and 'Recommended' by moderators, which helps users know the answer solved the author's problem.