Please help me. ImapException: Previous operation has not finished yet.



Dear ComponentPro 

Following error is traced by using the IMAP Client in threads.

Unhandled Exception: ComponentPro.Net.Mail.ImapException: Previous operation has not finished yet.

   at ComponentPro.Net.Mail.ImapClient.AsyncBeginLck() in ComponentPro.UltimateMail\UltimateMail\Net.Imap\ImapClient.cs:line 4175

   at ComponentPro.Net.Mail.ImapClient.SendCommand(String command, Object[] parameters) in EmlMigrationForExchange\ComponentPro.UltimateMail\UltimateMail\Net.Imap\ImapClient.cs:line 2387

In my code snip, it try to create ImapClient object and then connect to the IMAP server in number of thread. 

private static void TestInThread(List<string> Users)


    foreach(string user in Users)

        System.Threading.ThreadPool.QueueUserWorkItem(ConnectToServer, user);

static void ConnectToServer(object asyncState)




        string[] user = Convert.ToString(asyncState).Split(new char[] { ',' });


        ComponentPro.Net.Mail.ImapClient imapClient = new ComponentPro.Net.Mail.ImapClient();

        imapClient.Connect("", 143);

        imapClient.Authenticate(user[0], user[1]);


    catch (Exception ex) { Console.WriteLine(ex);     }


Do you have any ideas for resolving?

edited 11/16/2017 12:41:36 AM
asked 2/20/2012 8:08:13 AM
add a comment

1 Answers


I’m sorry.

This is in my fault.

Thank you.

answered 11/16/2017 12:41:36 AM
add a comment

Your Answer

Not the answer you're looking for? Browse other questions tagged imap or ask your own question.