gpt4 book ai didi

c# - 该帐户无权模拟请求的用户

转载 作者:行者123 更新时间:2023-11-30 22:20:02 24 4
gpt4 key购买 nike

我在尝试访问资源邮箱时遇到此错误。请任何人帮助我。我是 EWS 新手。

我可以通过 OWA(Outlook 网络应用程序)访问资源邮箱。但我不是这个邮箱的所有者,因为它是共享邮箱。

我的代码:

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);
}

最佳答案

问题可能是您没有模拟邮箱的权限,但您可能具有委托(delegate)访问权限。请参阅我对这个类似问题的回答,了解当您具有委托(delegate)访问权限时如何访问邮箱: https://stackoverflow.com/a/9242792/64161

关于c# - 该帐户无权模拟请求的用户,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/15204411/

24 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com