【问题标题】:Connect to Exchange email with windows authentication使用 Windows 身份验证连接到 Exchange 电子邮件
【发布时间】:2014-09-29 18:36:58
【问题描述】:

是否可以通过 Windows 身份验证连接到 Exchange 邮箱?由于安全合规性,我不能在程序中设置密码。如果是,如何?谢谢。

工作解决方案

代码

using Microsoft.Exchange.WebServices.Data;
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
service.UseDefaultCredentials = true;
service.AutodiscoverUrl("username@domain.tld");

【问题讨论】:

  • 您可能可以使用 UseDefaultCredentials 之类的东西来验证登录用户的身份。这在一定程度上取决于您要执行的操作:发送电子邮件、阅读电子邮件等。
  • 谢谢,我会试试的,我需要下载最后收到的电子邮件的附件。

标签: c# authentication exchange-server


【解决方案1】:

如果您使用 Exchange Web 服务中的 ExchangeServiceBinding 类,则您有 UseDefaultCredentials 属性。将此设置为 true 将使身份验证使用当前用户。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2019-05-20
    • 2019-09-12
    • 1970-01-01
    • 2023-03-18
    • 2012-08-10
    • 1970-01-01
    相关资源
    最近更新 更多