将Microsoft图形消息转换为.msg格式
我正在使用MS Graph API获取消息,但是我需要将其转换为.msg文件并将其存储在我的计算机上,有没有办法这样做?
我需要掩盖messagetobesavedasmsg
作为.msg
格式:
graphClient.users(properties.getUser()).sendMail(
UserSendMailParameterSet.newBuilder().withMessage(msg).withSaveToSentItems(saveToSentItems).build())
.buildRequest().post();
//Start saving .msg format
MessageCollectionPage messages = graphClient.users(properties.getUser()).messages()
.buildRequest()
.get();
String msgID = messages.getCurrentPage().get(0).id;
Message messageToBeSavedAsMSG = graphClient.users(properties.getUser()).messages(msgID)
.buildRequest()
.get();
I am using MS Graph API to get the message but I need to convert it to .msg file and store it on my machine, is there a way to do this?
I need to covert messageToBeSavedAsMSG
as .msg
format:
graphClient.users(properties.getUser()).sendMail(
UserSendMailParameterSet.newBuilder().withMessage(msg).withSaveToSentItems(saveToSentItems).build())
.buildRequest().post();
//Start saving .msg format
MessageCollectionPage messages = graphClient.users(properties.getUser()).messages()
.buildRequest()
.get();
String msgID = messages.getCurrentPage().get(0).id;
Message messageToBeSavedAsMSG = graphClient.users(properties.getUser()).messages(msgID)
.buildRequest()
.get();
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
MS Graph不能为此提供任何东西。文件格式仅特定于Windows上的Outlook。
在MSDN中完全描述。 MS Graph(NOR EWS)不会以任何方式公开此类文件。作为可能的解决方法,您可以创建一个msg文件并将EML导入其中,请参见如何创建.msg”文件而不使用MFC中的Outlook?有关此信息的更多信息。
MS Graph doesn't provide anything for that. The file format is specific to Outlook on Windows only.
The MSG file format is described in full in MSDN. MS Graph (nor EWS) doesn't expose such files in any way. As a possible workaround you can create an MSG file and import EML into it, see How to create ".msg" file without using outlook in mfc? for more information on that.