I'm trying to download mailMessage from exchange 2010 sp1 using EWS.
any attempt to call "FetchMessage" function cause WebException
The underlying connection was closed: An unexpected error occurred on a receive.
ListMessages, DeleteMessage, GetMailboxInfo works win no problems.
Any ideas way this happens?
ServicePointManager.ServerCertificateValidationCallback =
delegate(Object obj, X509Certificate certificate, X509Chain chain, SslPolicyErrors errors)
{
// trust any certificate
return true;
};
changeWebServiceClient client = new ExchangeWebServiceClient(@"https://vm-dctest/ews/Exchange.asmx",
new NetworkCredential("ss", "123", "testdomain"));
var fi = client.GetFolderInfo(client.GetMailboxInfo().InboxUri);
MapiContactCollection map= client.ListMailboxes();
foreach (var item in client.ListMessages(fi.Uri))
{
client.FetchMessage(item.UniqueUri);
}
// UPD
I have successfully downloaded mail Messages
using EWS 2.0 (Microsoft.Exchange.WebServices)
What I'm doing wrong with aspose.email ?