Outlook Rest API:使用Outlook Rest API下载.eml文件类型的电子邮件附件 [英] Outlook Rest API: Download the email attachments of type .eml files using outlook rest API

查看:122
本文介绍了Outlook Rest API:使用Outlook Rest API下载.eml文件类型的电子邮件附件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我遵循了下载电子邮件附件的文档.

I followed this documentation to download the attachments of email.

以下是API响应.

Below is the API response.

如果电子邮件附件类型为FileAttachment,则我可以在api响应中获取文件内容并可以保存附件. 如果电子邮件附件类型为ItemAttachment,则无法在api响应中获取文件内容.当我用Google搜索时,发现了 堆栈溢出问题.我使用了答案中提到的其余API.但是它以html格式提供itemAttachment内容.如果该ItemAttachment中包含任何fileattachment,那么我将无法访问它.

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.

有没有可用的API将itemAttachment作为.eml文件而不是html下载?

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

任何建议/答案都将受到欢迎.

Any suggestion/answers would be more than welcome.

推荐答案

我假设.eml表示您要检索MIME格式的电子邮件?

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

Microsoft Graph API目前不支持检索电子邮件的原始MIME内容.这是一个常见的请求,并且已有一个

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.

如果这是您的方案的硬性要求,则可能需要看一下Exchange Web服务(EWS). 消息对象由EWS包含 MimeContent 属性.

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.

这篇关于Outlook Rest API:使用Outlook Rest API下载.eml文件类型的电子邮件附件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆