c# - Aspose.Email assembly to check a mail server ListMessages method fails -


i using aspose.email assembly check mail server received mails in inbox. emailclient.listmessages(emailclient.mailboxinfo.inboxuri) method in code below returns following error,

error:

the remote server returned error: (405) method not allowed. 

code:

system.net.networkcredential credential = new system.net.networkcredential("username", "password", "domainname");  aspose.email.exchange.exchangeclient emailclient = new aspose.email.exchange.exchangeclient("mailserveruri", credential);  aspose.email.exchange.exchangemessageinfocollection messageinfocollection = emailclient.listmessages(emailclient.mailboxinfo.inboxuri); 

stack trace:

 @ aspose.email.exchange.exchangeclient.getmailboxinfo(string mailbox)  @ aspose.email.exchange.exchangeclient.getmailboxinfo()  @ aspose.email.exchange.exchangeclient.get_mailboxinfo()  @ acs.pmo.mainform.processaction() in d:\projects\mainform.cs:line 54  @ acs.pmo.clientservice.mcpclient.executeprocess() 

edit

aspose.email.exchange.exchangeclient emailclient = new aspose.email.exchange.exchangeclient("mailserveruri", credential); 

the mailserveruri targeted exchange web service.

finally got corrected.....

exchangewebserviceclient should used in case of exchange webservice. use class instead of exchangeclient.the server url different in case of ews.the code used overcome error follows,

 exchangewebserviceclient client = new exchangewebserviceclient("https://exchange-server-host/ews/exchange.asmx", "username", "password", "domain"); 

for further details check link below,

http://www.aspose.com/community/forums/thread/301094/405-method-not-allowed-while-connecting-to-exchange-web-service.aspx


Comments

Popular posts from this blog

java - Play! framework 2.0: How to display multiple image? -

gmail - Is there any documentation for read-only access to the Google Contacts API? -

php - Controller/JToolBar not working in Joomla 2.5 -