The family of IMailFolder.Append methods have the return type UniqueId? (or an IList<> of that). For these return values, the documentation says
The UID of the appended message, if available; otherwise, null.
Would you mind elaborating a bit here about this "if available" business? For what sorts of reasons would these methods return null?
If the IMAP server does not support the UIDPLUS extension, then the return value will always be null.
Theoretically, if the server supports UIDPLUS, then it should always return a valid UniqueId... but as we all know, theory and reality can vary greatly.
I see. Thanks for that explanation.
Suppose we append a single MimeMessage. How would you recommend following up a call to Append in order to obtain the UniqueId of the just appended MimeMessage?
probably something along the lines of:
var uids = folder.Search (SearchQuery.HeaderContains ("Message-Id", message.MessageId));
var appendedUid = uids[uids.Count - 1];
@jstedfast, just a small thing!
Search method returns IList<UniqueId> so you should use Count instead of Length, 馃槈
Ah, thanks, I've updated the code in my previous comment.
Most helpful comment
probably something along the lines of: