Archived Forum Post

Index of archived forum posts


IMAP: Fetch new messages?

Oct 22 '12 at 12:31

My application saves the UID of the last email it downloaded. How do I download all of the new emails at LastUid+1 and beyond?


Your application would call the imap.Search method, passing a search criteria that specifies a UID range. For example:

messageSet = imap.Search("UID 83:*", 1) 
See for more information.

The message set object can returned by the Search method can then be passed to a method for downloading, such as FetchBundle, FetchBundleAsMime, FetchHeaders, etc.