如何解决将 Microsoft GraphAPI OutlookItem 响应另存为 eml
我使用的 GraphAPI 版本如下:
//Microsoft graph API dependencies
compile group: 'com.microsoft.graph',name: 'microsoft-graph',version: '3.0.0'
// https://mvnrepository.com/artifact/com.azure/azure-identity
compile group: 'com.azure',name: 'azure-identity',version: '1.2.5'
我们遇到过电子邮件中存在 .msg(outlook) 附件的情况。不幸的是,对于 .msg/.eml 文件类型的 ItemAttachment 响应,内容字节不可用。
我能够使用以下调用并获得 Mime 响应。
https://graph.microsoft.com/v1.0/me/messages/<MessageID>/attachments/<AttachmentId>/$value
Graph API Explorer 的响应
问题:如何将此响应保存到 eml Outlook 文件?我尝试将结果重命名为 .eml/.msg 但没有任何效果。有没有第三方库?
请注意,我可以通过转换为字节来保存其中的附件。
byte [] result = Base64.getMimeDecoder().decode(bytes);
谢谢。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。