'How to get outlook email message MIME content using Graph client C#

How to get outlook email message MIME content using Graph client C# like in EWS call byte [] MesageBlob = EmailMessage.MimeContent.Content; and .eml file name



Solution 1:[1]

Even though Outlook does not save messages in MIME format, there are two ways you can get an Outlook message body in MIME format:

  • You can append a $value segment to a get-message operation on that message.

    GET /users/{id}/messages/{id}/$value
    
  • If the message is attached to an Outlook item or group post, you can append a $value segment to a get-attachment operation on that item or group post. In either case, your app must have the appropriate permissions to access the Outlook item or group post in order to apply the get-message or get-attachment operation.

    GET /users/{id}/events/{id}/attachments/{id}/$value
    

Read more about that in the Get MIME content of a message article.

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 Eugene Astafiev