问题是在Exchange Web服务中阅读电子邮件。我正在使用c#winform(2012)
错误:服务XmlDeserializatin异常是unhandles
预期的XML节点类型是XmlDeclaration,但实际类型是Element。
ExchangeService service=new ExchangeService (ExchangeVersion.Exchange2010);
service.Credentials=new WebCredentials ("xxx@outlook.com","Password","outlook.com");
service.AutodiscoverUrl("xxxx@outlook.com",RedirectionUrlValidationCallback);
service.TraceEnabled = true;
service.TraceFlags = TraceFlags.All;
FindItemsResults<Item> findResults=service.FindItems(WellKnownFolderName.Inbox,new ItemView(10));
foreach (Item item in findResults.Items)
{
item.Load();
txtRequest.Text +=item.Subject.ToString();
}
答案 0 :(得分:0)
您是否尝试连接到outlook.com邮箱?您无法使用EWS连接到outlook.com。