Home > Forum > ASP.NET > Accessing Email exchange server in c#.

Accessing Email exchange server in c#.

by sagar nagwekar   on Oct 10, 2013   Category: ASP.NET  |  Views: 3158    |  Points: 5   |  Starter 
Hi all,

I am trying to access email exchange server using following simple c# code:

ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010_SP1);
service.UseDefaultCredentials = false;

string credUser = "sagar.n@XXXX.com";
string credPwd = "XXXX";

service.Credentials = new NetworkCredential(credUser, credPwd);
string exSvcUrl = "https://XX.XX.XXX.XXX/owa/auth/logon.aspx";
service.Url = new Uri(exSvcUrl);
service.TraceEnabled = true;

ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(delegate { return true; });
ItemView view = new ItemView(20);

FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Calendar, view);

foreach (Item item in findResults.Items)

getting error at line:

FindItemsResults<Item> findResults = service.FindItems(WellKnownFolderName.Calendar, view);

as "The response received from the service didn't contain valid XML."

Any Solution??

Bookmark and Share:
  User Reply  | Ask a question  |   Reply 
  Re :Accessing Email exchange server in c#.   
by Thamil
on Oct 31 2013 1:12AM
Points : 10
Hi sagar nagwekar,

Please check this below link will help you on this.


Recent Post

Latest Posts