gpt4 book ai didi

c# - 自动发现本地异常 : The Autodiscover service couldn't be located

转载 作者:太空宇宙 更新时间:2023-11-03 11:18:16 26 4
gpt4 key购买 nike

我想使用 .NET 3.5 访问交换服务器。这是我的代码:

class Program
{
static void Main(string[] args)
{
try
{
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
service.Credentials = new WebCredentials("email_test@xxx.com", "abcd");

service.AutodiscoverUrl("email_test@xxx.com");

EmailMessage message = new EmailMessage(service);
message.Subject = "Interesting";
message.Body = "The proposition has been considered.";
message.ToRecipients.Add("abc@xxx.com");
message.SendAndSaveCopy();
}
catch (Exception ex)
{
Console.WriteLine(ex.ToString());
}
}
}

我指的是 this article编写代码:

但是我收到了这个异常:

AutodiscoverLocalException: The Autodiscover service couldn't be located.

有人可以帮忙吗?

最佳答案

我遇到了这个问题,这是因为用户帐户被锁定了。

关于c# - 自动发现本地异常 : The Autodiscover service couldn't be located,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/11929607/

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