login about faq

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.

asked Mar 31 '14 at 06:42

kuligintim's gravatar image

kuligintim
316911


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.

link

answered Mar 31 '14 at 14:24

chilkat's gravatar image

chilkat ♦♦
11.8k316358421

Your answer
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or __italic__
  • **bold** or __bold__
  • link:[text](http://url.com/ "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported

Tags:

×175
×14
×4
×3

Asked: Mar 31 '14 at 06:42

Seen: 1,279 times

Last updated: Mar 31 '14 at 14:24

powered by OSQA