This project is read-only.

how to move the mails using imapclient

Jan 23, 2013 at 3:14 PM


i am using imapclient class to access the Gmail account, well i am able to download the attachements. it's good and getting error when no unread messages in mail. 

and also i need some help how can we move the mails from one inbox folder to another folder.


Jan 24, 2013 at 10:43 AM

You can move mail to other folder.
ImapClient provide a feature to communicate with native IMAP command.
Here is a sample code to move folder.
var cl = new ImapClient("...");
//Set property...
cl.SelectFolder("your folder name");
cl.ExecuteCopy(1,1, "target folder name");
cl.DeleteMail(1); //Delete mail from source folder

There is no intuitive way to move folder.
I think your comment is a very useful feature.
I'll add MoveMail method to ImapClient in next release.
Like this.
cl.MoveMail("source folder name", 1, "target folder name");

Thank you!

Jan 24, 2013 at 11:10 AM
Edited Jan 24, 2013 at 11:10 AM

Thanks a lot.

is there any way to find out the uid for mail using imapclient ?

Jan 24, 2013 at 11:24 AM

Use ExecuteSearch method of ImapClient object.
It return SearchResult object that include a property of mail index list.

Jan 24, 2013 at 12:10 PM

Thanks for your help.

  while i am retrieve the mails from inbox through imapclient object . i am getting following error : 

Response Timeout .

Scenario : 

i am having 5 unread messages. i am Using loop and GetMessage() method.

Jan 24, 2013 at 11:15 PM

Did you call Authenticate method of ImapClient object before get message?

Jan 25, 2013 at 8:52 AM


i called Authenticate method before call the get message.

Jan 26, 2013 at 6:53 AM

Please set ReceiveTimeout property more long of ImapClient.


Feb 5, 2015 at 7:12 AM
Edited Feb 5, 2015 at 7:14 AM
Higty : I didn't see MoveMail method when I created the instance of your IMAPClient object. Will you please let me know have you created this method. in your latest version.

If not then will you please let me know when you gonna integrate that in your latest version.
Feb 13, 2015 at 9:40 AM

Sorry late reply.
I'm moving to HigLabo library to Github and I don't have a time to investigate this error.
After moving to gitHub, I'll add MoveMail method if it can be.

Please wait for one or some week.