Click here to Skip to main content
15,887,485 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
im trying to read email from exchange server using the below script :

but im getting this error :

DTD is prohibited in this XML document.

i try this solution :

XmlReaderSettings xrs = new XmlReaderSettings(); xrs.ProhibitDtd = false; but error stil there .


What I have tried:

XmlReaderSettings xrs = new XmlReaderSettings();
           xrs.ProhibitDtd = false;
           ExchangeService service = new ExchangeService(ExchangeVersion.Exchange2013);
           ServicePointManager.ServerCertificateValidationCallback = new RemoteCertificateValidationCallback(CertificateValidationCallBack);
           service.Credentials = new WebCredentials("user", "password" , "domain");
           service.UseDefaultCredentials = true;
           service.TraceEnabled = true;
           service.TraceFlags = TraceFlags.All;


           service.Url = new Uri("https://IP/");
           Folder inbox = Folder.Bind(service, WellKnownFolderName.Inbox);
           Label1.Text = inbox.DisplayName.ToString();`
Posted

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900