How to save email attachment in outlook email to local drive through Graph API

Anonymous
2023-02-13T06:35:41.0766667+00:00

Hi Team,

I am trying to read the mails and save the attachments in local drive from outlook by using Graph API, so here the problem is I am unable to save the mail attachments(.eml) but am able to save remaining like Microsoft Excel, Word, PDF, Image attachments. For all remaining items I am getting content bytes (Image 1) but only for .eml files I am unable to get the content bytes (Image 2).

Please check the below images for your reference.

sc1 (2)

sc2 (2)

Microsoft Security | Microsoft Graph
0 comments No comments
{count} vote

2 answers

Sort by: Most helpful
  1. sravan kumar reddy 0 Reputation points
    2023-02-20T10:25:45.7933333+00:00

    Even I am facing the same issue , can you write me back on ******@outlook.com ,

    0 comments No comments

  2. Mehtab Siddique (MINDTREE LIMITED) 971 Reputation points
    2023-02-27T14:07:29.4666667+00:00

    Hi Yashwanth Gannavarapu,

    To Get the MIME raw contents of a contact attachment on a message: please check this sample example here given in the Microsoft docs:

    User's image

    For more information: https://learn.microsoft.com/en-us/graph/api/attachment-get?view=graph-rest-1.0&tabs=http#example-7-get-the-mime-raw-contents-of-a-contact-attachment-on-a-message


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

    0 comments No comments

Your answer

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