| IImapFolderSearchAsync(String, CancellationToken) Method |
Asynchronously search the folder for messages matching the specified query.
Namespace: MailKit.Net.ImapAssembly: MailKit (in MailKit.dll) Version: 4.7.1
Syntax Task<SearchResults> SearchAsync(
string query,
CancellationToken cancellationToken = default
)
Parameters
- query String
- The search query.
- cancellationToken CancellationToken (Optional)
- The cancellation token.
Return Value
TaskSearchResultsAn array of matching UIDs.
Exceptions Remarks
Sends a UID SEARCH command with the specified query passed directly to the IMAP server
with no interpretation by MailKit. This means that the query may contain any arguments that a
UID SEARCH command is allowed to have according to the IMAP specifications and any
extensions that are supported, including RETURN parameters.
See Also