0
我正在使用UseDefaultCredentials = true来验证EWS。它适用于发送和接收,但我现在需要找出当前用户的电子邮件地址,但在API中看不到任何明显的方式。如何使用Exchange Web服务查找当前用户自己的电子邮件地址?
任何人都可以帮忙吗?
我正在使用UseDefaultCredentials = true来验证EWS。它适用于发送和接收,但我现在需要找出当前用户的电子邮件地址,但在API中看不到任何明显的方式。如何使用Exchange Web服务查找当前用户自己的电子邮件地址?
任何人都可以帮忙吗?
最简单的办法就是要利用ConvertId与普通的电子邮件地址([email protected]总是为我工作),例如,如果你使用
Folder Inbox = Folder.Bind(service, WellKnownFolderName.Inbox);
AlternateId aiAlternateid = new AlternateId(IdFormat.EwsId, Inbox.Id.UniqueId, "[email protected]");
AlternateIdBase aiResponse = service.ConvertId(aiAlternateid, IdFormat.EwsId);
Console.WriteLine(((AlternateId)aiResponse).Mailbox);
EWS应该返回邮箱的正确Smtp地址在此操作返回的邮箱属性。
Cheers Glen