Imap FolderExpunge Async(Cancellation Token) Method
Asynchronously expunge the folder, permanently removing all messages marked for deletion.
Definition
Namespace: MailKit.Net.Imap
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
An asynchronous task context.
IMailFolderExpungeAsync(CancellationToken)
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
public override Task ExpungeAsync(
CancellationToken cancellationToken = default
)Parameters
- cancellationToken CancellationToken (Optional)
- The cancellation token.
Return Value
TaskAn asynchronous task context.
Implements
IMailFolderExpungeAsync(CancellationToken)IMailFolderExpungeAsync(CancellationToken)
Remarks
The EXPUNGE command permanently removes all messages in the folder that have the Deleted flag set.
For more information about the EXPUNGE command, see rfc3501.
Exceptions
| ObjectDisposedException | The ImapClient has been disposed. |
| FolderNotOpenException | The ImapFolder is not currently open in read-write mode. |
| ServiceNotConnectedException | The ImapClient is not connected. |
| ServiceNotAuthenticatedException | The ImapClient is not authenticated. |
| 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. |