Microsoft Graph API SDK .NET Issues getting other users emails

微笑、不失礼 提交于 2019-12-02 04:22:23

While you are able to get your collection of users successfully, you have to make another request to receive the messages. This would look something like:

IUserMessagesCollectionPage userMessages = 
             graphApi.Users["user_id"].Messages.Request()
             .GetAsync().Result;

To answer your second question, at this time you cannot access the original recipient through the Graph API, but you can do this through EWS. This is due to the fact that you can only retrieve the SMTP message headers through EWS. You can read more about how to do this here.

If this is something you believe is valuable to you in the Graph, I would encourage you to post it in our UserVoice.

If you want to get the email as a file, you can simply get the body as bytes through the SDK:

byte[] asBytes = Encoding.Unicode.GetBytes(message.Body.ToString());
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!