C#获取Exchange 2007未读邮件问题
现在有一个问题,我在asp.net里使用EWS API 来获取exchange 2007 里的未读邮件,但是总会有一个提示:
The request failed. 远程服务器返回错误: (440) Login Timeout。
请问这个是否需要在exchange 设置什么啊?因为现在我公司的exchange有2,300人在用,我也不敢随便更改设置。请问有其他的办法么?下面是我的代码[code=C#][/code]实例化exchange类并指定exchange版本
ExchangeService exSercice = new ExchangeService(ExchangeVersion.Exchange2007_SP1);
System.Net.ServicePointManager.ServerCertificateValidationCallback = delegate(Object obj, System.Security.Cryptography.X509Certificates.X509Certificate certificate,
System.Security.Cryptography.X509Certificates.X509Chain chain, System.Net.Security.SslPolicyErrors errors) { return true; };
//指定exchange登录的地址
//
//指定邮箱登录名,密码,域名
exSercice.Credentials = new WebCredentials("xiangkun", "Aa123123", "MAPLE");
exSercice.Url = new Uri("http://172.24.1.83/owa/EWS/exchange.asmx");
//获取收件箱未读邮件
//EmailMessage email = new EmailMessage(exSercice,new ItemId(UniqueID);
//FindItemsResults<Item> finResult=exSercice.FindItems(WellKnownFolderName.Inbox,new ItemView(int,MaxValue));
Folder folder = Folder.Bind(exSercice, WellKnownFolderName.Inbox);
------解决方案--------------------
http://www.independentsoft.com/exchangewebservices/index.html