I'm working on a web application to access exchange server 2010 to get emails from the server. The question is, we don't have domain name for this server. What I know is it's IP address. Is that possible to use Exchange Web Service to access the server? This is my code:
ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2010); service.Credentials=new NetworkCredential("StevenZack","123456","208.243.49.20"); //service.AutodiscoverUrl("stevenzack@mail2.local"); service.Url = new Uri("https://208.243.49.20/EWS/Exchange.asmx"); FindItemsResults findResults = service.FindItems( WellKnownFolderName.Inbox, new ItemView(10));
foreach (Item item in findResults.Items)
{
div_email.InnerHtml = item.Subject + "<br />";
}
It comes out with an error of "The remote certificate is invalid according to the validation procedure"
How to deal with this situation? Any idea? Thank you for your time!