Archived Forum Post

Index of archived forum posts

Question:

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?


Answer

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 http://www.chilkatsoft.com/p/p_379.asp 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.