Click or drag to resize
MimeKit

MailFolderExpunge(CancellationToken) Method

Expunge the folder, permanently removing all messages marked for deletion.

Namespace: MailKit
Assembly: MailKit (in MailKit.dll) Version: 4.3.0
Syntax
C#
public abstract void Expunge(
	CancellationToken cancellationToken = default
)

Parameters

cancellationToken  CancellationToken  (Optional)
The cancellation token.

Implements

IMailFolderExpunge(CancellationToken)
Exceptions
ExceptionCondition
ObjectDisposedException The IMailStore has been disposed.
ServiceNotConnectedException The IMailStore is not connected.
ServiceNotAuthenticatedException The IMailStore is not authenticated.
FolderNotOpenException The folder is not currently open in read-write mode.
OperationCanceledException The operation was canceled via the cancellation token.
IOException An I/O error occurred.
ProtocolException The server's response contained unexpected tokens.
CommandException The command failed.
Remarks

Expunges the folder, permanently removing all messages marked for deletion.

Note  Note
Normally, an MessageExpunged event will be emitted for each message that is expunged. However, if the mail store supports the quick resynchronization feature and it has been enabled via the EnableQuickResync(CancellationToken) method, then the MessagesVanished event will be emitted rather than the MessageExpunged event.
See Also