Hello,
In one of our project requirement is to read email and fetch attachments if any. We achieved this functionality via MS Graph API where we are getting all attachment in file format except email.
Please refer attached file for the response where attachment is type of email and response is in chunk and not in single file content.
Struggling to get email as a file, any pointer would help
Thanks
Prajakta Roshankhede
Hi,
If you need to retrieve the email as file ( as .eml) you can use the endpoint
/users/{id}/messages/{id}/$value
This is the same for attachments:
/users/{id}/outlook/tasks/{id}/attachments/{id}/$value
This is the official documentation links: get-mime-message
Br,
AL
Hello @Andrea Lembo,
I did try the same solution and was about to post the same.
addition step is to store response in .eml file.
Thanks for your input.
RegardsPrajakta Roshankhede
Hi Prajakta,
I can easily see two important JSON properties that talk aboutL:
of your email.
Also I noticed the property
"hasAttachments":false
This email doesn't have any attachment. Hence you're unable to see any of them.
Hence, the email body and preview is available. Attachments are not sent in this email, which is why it has false value in hasAttachments.
Let me know if I misunderstood something in your question.
Hello Ravi,
This response itself attachment of email (Read Email -> Fetch Attachment -> Attachment Response(attached sample))If attachment is type of word doc then response would be refer attached response file