Unable to connect to Mail server using ImapClient


This is the first time we are trying to use the ASPOSE ImapClient using the following line of code:

ImapClient client = new ImapClient("xxx.xx.x.xxx", 123, "xxx", "xxx");


but after examining the client object, I found the ConnectionState as closed and when I try to select Inbox folder of primary mailbox, getting error Command failure. What is the possible reason behind this?



Hi Rahul,

Thank you for using Asose.Email for .NET.

Could you please share which server you are trying to connect using our ImapClient component? Please note that if the server provides an SSL enabled connection, then you need to connect to the server by setting the SSL flag as well. Please refer to our online documentation article [Connecting with SSL enabled IMAP server ](http://www.aspose.com/docs/display/emailnet/Connecting+with+SSL+Enabled+IMAP+Server) for further details in this regard.

Hi Kashif,

Thanks for your quick reply.

We are trying to connect the Microsoft Exchange Server 7. Yes SSL is enabled on server. I try your suggested settings for SSL but getting error Server can not be authenticated. Do we need to pass some other information.

Please refer the attachment for the code written n error we got.



Hi Rahul,

We have tried to re-produce the scenario using your code and our test account credentials. I am afraid to share that I could not observe the issue and connection was established successfully.

Now to proceed further, I would request you to arrange some test account on the said server and provide us the credentials for testing. Please make arrangements that the temporary account remains available until our testing is completed. It will help us to re-produce the scenario and provide assistance as soon as possible.