Microsoft Graph API SDK .NET Issues getting other users emails

后端 未结 1 589
时光说笑
时光说笑 2021-01-24 22:49

I am using the Microsoft Graph SDK as downloaded from NuGet (1.2). I authenticate to Azure AD (using ADAL).

I am using Client Credentials flow (not authenticated as any

相关标签:
1条回答
  • 2021-01-24 23:08

    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());
    
    0 讨论(0)
提交回复
热议问题