我想使用 .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());
}
}
}
我指的是这篇文章来编写代码:
但我收到了这个例外:
AutodiscoverLocalException:找不到自动发现服务。
任何人都可以帮忙吗?