how to move the mails using imapclient

Jan 23, 2013 at 2:14 PM

hi 

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.

 

Coordinator
Jan 24, 2013 at 9:43 AM

You can move mail to other folder.
http://stackoverflow.com/questions/122267/imap-how-to-move-a-message-from-one-folder-to-another?rq=1
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 10:10 AM
Edited Jan 24, 2013 at 10:10 AM

Thanks a lot.

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

Coordinator
Jan 24, 2013 at 10:24 AM

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

Jan 24, 2013 at 11:10 AM

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.

Coordinator
Jan 24, 2013 at 10:15 PM

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

Jan 25, 2013 at 7:52 AM

yes,

i called Authenticate method before call the get message.

Coordinator
Jan 26, 2013 at 5:53 AM

Please set ReceiveTimeout property more long of ImapClient.

regards

Feb 5, 2015 at 6:12 AM
Edited Feb 5, 2015 at 6: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.
Coordinator
Feb 13, 2015 at 8:40 AM
Hi.

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.