Outlook Rest API: Download the email attachments of type .eml files using outlook rest API

青春壹個敷衍的年華 提交于 2019-12-20 04:46:53

问题


I followed this documentation to download the attachments of email.

Below is the API response.

If email attachment type is FileAttachment, I am able to get the file content in api response and able to save the attachment. If email attachment type is ItemAttachment, I am not able to get the file content in api response. When I googled for it, I found this stack overflow question. I used the rest API mentioned in the answer. But it's giving itemAttachment content in html format. And if that ItemAttachment has any fileattachment in it, then I am unable to access it.

Is there any API available to download the itemAttachment as .eml file not as html?

Any suggestion/answers would be more than welcome.


回答1:


I assume by .eml you mean you'd like to retrieve the email in MIME format?

Retrieving an email's raw MIME content isn't supported by Microsoft Graph API at this time. This has been a common request and there is an existing UserVoice request for it.

If this is a hard requirement for your scenario, you may want to take a look at Exchange Web Services (EWS). The Message object returned by EWS includes a MimeContent property.



来源:https://stackoverflow.com/questions/46538814/outlook-rest-api-download-the-email-attachments-of-type-eml-files-using-outloo

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!