Currently working with Mailkit but having problem getting a certain range from the imap server
var uids = await client.Inbox.SortAsync(SearchQuery.All, new [] {OrderBy.ReverseDate});
This helps me get all the uids from the server but in case I want only 10 I don't know how to achieve it. Should I get all the Uids and then trim it down to 10 uids to further fetch the body structure.
CodePudding user response:
The IMAP protocol doesn't have a way to get back only 10 results, but you can limit the UID range it searches and/or sorts.
var uids = await client.Inbox.SortAsync(SearchQuery.Uids (subRange), new [] {OrderBy.ReverseDate});