Imap FolderStatus Async Method
Asynchronously update the values of the specified items.
Definition
Namespace: MailKit.Net.Imap
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
An awaitable task.
IMailFolderStatusAsync(StatusItems, CancellationToken)
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
public override Task StatusAsync(
StatusItems items,
CancellationToken cancellationToken = default
)Parameters
- items StatusItems
- The items to update.
- cancellationToken CancellationToken (Optional)
- The cancellation token.
Return Value
TaskAn awaitable task.
Implements
IMailFolderStatusAsync(StatusItems, CancellationToken)IMailFolderStatusAsync(StatusItems, CancellationToken)
Remarks
Updates the values of the specified items.
The Status(StatusItems, CancellationToken) method MUST NOT be used on a folder that is already in the opened state. Instead, other ways of getting the desired information should be used.
For example, a common use for the Status(StatusItems, CancellationToken) method is to get the number of unread messages in the folder. When the folder is open, however, it is possible to use the Search(SearchQuery, CancellationToken) method to query for the list of unread messages.
For more information about the STATUS command, see rfc3501.
Exceptions
| ObjectDisposedException | The ImapClient has been disposed. |
| ServiceNotConnectedException | The ImapClient is not connected. |
| ServiceNotAuthenticatedException | The ImapClient is not authenticated. |
| FolderNotFoundException | The ImapFolder does not exist. |
| NotSupportedException | The IMAP server does not support the STATUS command. |
| OperationCanceledException | The operation was canceled via the cancellation token. |
| IOException | An I/O error occurred. |
| ImapProtocolException | The server's response contained unexpected tokens. |
| ImapCommandException | The server replied with a NO or BAD response. |