SMTP地址没有使用Microsoft.Exchange.WebServices与其关联的邮箱

时间:2015-07-23 08:56:22

标签: login smtp

我尝试过以下代码。由于我已在此服务器上拥有我的帐户,因此我收到了主题中提到的错误。

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010);
        service.Credentials = new NetworkCredential("****", "*****", "*****");

        service.Url = new Uri("https://******/ews/exchange.asmx");

        ServicePointManager.ServerCertificateValidationCallback = delegate { return true; };

        FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Inbox, new ItemView(1));

        foreach (Item item in findResults.Items)
        {
            if (item.HasAttachments && item.Attachments[0] is FileAttachment)
            {
                FileAttachment fileAttachment = item.Attachments[0] as FileAttachment;
                fileAttachment.Load(@"\\c:\\filesave\\" + fileAttachment.Name);
            }

        }

谢谢, Kandarp

1 个答案:

答案 0 :(得分:0)

您是否尝试过更新Exchange Server? (您正在运行2013服务器吗?)

虽然我也遇到了这个错误,但我搜索了一会儿,发现了this

也许您检查系统上是否已有this update

无论如何这解决了我的问题