Question:
Hello!
How can I move messages from one mailbox to another? For example, from Inbox to CustomFolder. I use next code for this:
foreach (int uid in args.Uids)
{
if (_imap.Copy(uid, true, args.ToFolder))
{
_imap.SetFlag(uid, true, "Deleted", 1);
copied.Add(uid);
}
}
if (copied.Count > 0)
{
_imap.ExpungeAndClose();
....
I didn't find any method for moving.
The IMAP protocol itself does not provide a "MOVE to another folder" command. The only way to do it is to copy the email to another folder, and then delete it from the original folder.