Click or drag to resize

ImapSearchAsync(ICriterion, CancellationToken) Method

Gets UIDS of all messages that match specified search criteria using server-side searching sorted from oldest to newest. Use And(ICriterion), Or(ICriterion, ICriterion) and other Expression methods to create a valid search query. You can also pass SimpleImapQuery to this method.

Namespace: Limilabs.Client.IMAP
Assembly: Mail (in Mail.dll) Version: 3.0.26106.1555
Syntax
public Task<List<long>> SearchAsync(
	ICriterion criterion,
	CancellationToken cancel = default
)

Parameters

criterion  ICriterion
Search criteria. Use And(ICriterion) to join several criteria.
cancel  CancellationToken  (Optional)
A cancellation token that can be used to signal the asynchronous operation should be canceled.

Return Value

TaskListInt64
UID list sorted from oldest to newest.
Example
List<long> uids = imap.Search(Expression.And(Expression.Subject("report"), Expression.HasFlag(Flag.Unseen)));
See Also