当前位置: 首页 > 知识库问答 >
问题:

EWS: Mailbox address from a Calendar FolderId, is it possible?

阴靖
2023-03-14

These calendars can be associated with the authenticated user's mailbox, a shared mailbox, an impersonateddelegated mailbox, or a public mailbox.And now I'd like to go from the FolderId to the mailbox address.

Ideally there'd be a function to

string address = getMailboxAddress(new FolderId("AAJk...AA="));

共有1个答案

黎同
2023-03-14

If you have the FolderId what you have is the EWS version of this https://msdn.microsoft.com/en-us/library/ee217297(v=exchg.80).aspx which means with the data you have doesn't contain the Email Address.You would be better at the time you store the CalendarId store the Email address its associated with.

You can try using ConvertId with a generic non resolvable email Address this should return the EmailAddress the folder belongs (won't work for Public Folder) to eg

     AlternateId aiAlternateid = new AlternateId(IdFormat.EwsId, SharedFoder.Id.UniqueId, "mailbox@domain.com");
    AlternateIdBase aiResponse = service.ConvertId(aiAlternateid, IdFormat.EwsId);
    Console.WriteLine(((AlternateId)aiResponse).Mailbox);

Cheers Glen

 类似资料:

相关问答

相关文章

相关阅读