I am currently working on a requirement which is about reading mails from Outlook using Outlook Exchange webservices. Using Microsoft.Office.Interop.Outllook.dll, I am able to read the emails but this requires Outlook to be installed in the machine where the code is being run. This does help me.
My requirement is like reading the emails from Outlook assuming that we know the Outlook account credentials. I tried using Microsoft.Exchange.WebServices.Data. But this is throwing me an error in AutodiscoverUrl().
Here is the error message:
Microsoft.Exchange.WebServices.Data.AutodiscoverLocalException was unhandled HResult=-2146233088 Message=Autodiscover blocked a potentially insecure redirection to https://autodiscover-s.outlook.com/autodiscover/autodiscover.xml.
Could someone help me in resolving this and successfully reading the emails irrespective or Outlook is installed and configured in that particular device where the code is scheduled to run as a task.