尝试访问资源邮箱时出现此错误。请有人帮助我。我是EWS的新手。
我可以通过OWA(Outlook Web App)访问资源邮箱。但是我不是此邮箱的所有者,因为它是共享邮箱。
我的代码:
ServicePointManager.ServerCertificateValidationCallback = CertificateValidationCallBack;
ExchangeService newExchangeService = new ExchangeService (ExchangeVersion.Exchange2007_SP1);
newExchangeService.Credentials = new NetworkCredential(username, password, domain);
newExchangeService.AutodiscoverUrl(email-id, RedirectionUrlValidationCallback);
newExchangeService.ImpersonatedUserId = new ImpersonatedUserId(ConnectingIdType.SmtpAddress, email_which_i_want_to_access);
Folder visitorsFolder = Folder.Bind(newExchangeService, WellKnownFolderName.Inbox);
foreach (Folder childfolder in visitorsFolder.FindFolders(new FolderView(10)))
{
Console.WriteLine(childfolder.DisplayName);
}
最佳答案
问题可能是您没有模拟邮箱的权限,但是您可能具有委托访问权限。请查看我对类似问题的回答,以了解在具有代理访问权限时如何访问邮箱:
https://stackoverflow.com/a/9242792/64161
关于c# - 该帐户无权模拟所请求的用户,我们在Stack Overflow上找到一个类似的问题:https://stackoverflow.com/questions/15204411/