Error connecting to exchange mailbox using WebDav

Posted by Warda on Stack Overflow See other posts from Stack Overflow or by Warda
Published on 2010-06-14T10:49:16Z Indexed on 2010/06/14 10:52 UTC
Read the original article Hit count: 414

Filed under:

We have a windows service that uses the “WebDAV .NET for Exchange” libraries to access the mail server. The WebDav libraries attempts to access the mailbox to process mails. The Error occurs on attempting to retrieve the mailbox contents.

The Code snippet below is how the code retrieves the mailbox contents:

NetworkCredential credential = new NetworkCredential(Username, Password, Domain); WebdavSession session = new WebdavSession(credential); session.UserMailbox = MailServerURL;

Resource resource = new Resource(session); if (UseFormsBasedAuthentication) resource.PerformFormsBasedAuthentication(https://owa.domain.company.org/[email protected]/Inbox");

Mailbox myMailbox = resource.Mailbox;

Calling the “resource.Mailbox” raises the following exception:

---> System.Net.WebException: The remote server returned an error: (405) Method Not Allowed. at System.Net.HttpWebRequest.GetResponse() at Independentsoft.Webdav.Exchange.Resource.a(String A_0, PropertyName[] A_1) at Independentsoft.Webdav.Exchange.Resource.e(String A_0) at Independentsoft.Webdav.Exchange.Resource.get_Mailbox() at

Any helps will be more than appreciated.

Thanks

© Stack Overflow or respective owner

Related posts about webdav