login about faq

How do I get the new UID of an IMAP email that I copied to another folder?

I tried to use [imap Search] but it seems that the search does not allow to specify an exact time. So if someone sent me two messages on the same day with the same subject, I could not distinguish between them.

asked Jul 17 '14 at 07:07

vomako's gravatar image


Use code like this to copy and get uid:

 if (_imap.AppendMail(Mailbox, email))
                newUid = _imap.AppendUid;

answered Jul 17 '14 at 08:24

kuligintim's gravatar image


Thank you. However, not all servers return the new UIDs when using AppendMail. Do I have to fetch all email headers then?

(Jul 17 '14 at 10:08) vomako

May be, but I have never worked with servers that doesn't return new UIDs. Try to fetch all headers or sync mailbox of appended message again.

(Jul 21 '14 at 03:51) kuligintim
Your answer
toggle preview

Follow this question

By Email:

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



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



Asked: Jul 17 '14 at 07:07

Seen: 850 times

Last updated: Jul 21 '14 at 03:51

powered by OSQA