Permanently removes all messages that have the \Deleted flag set from the specified mailbox.

Namespace: S22.Imap
Assembly: S22.Imap (in S22.Imap.dll) Version: 3.6.0.0 (3.6.0.0)

Syntax

C#
public void Expunge(
	string mailbox = null
)

Parameters

mailbox (Optional)
Type: System..::..String
The mailbox to remove all messages from that have the \Deleted flag set. If this parameter is omitted, the value of the DefaultMailbox property is used to determine the mailbox to operate on.

Implements

IImapClient..::..Expunge(String)

Exceptions

ExceptionCondition
S22.Imap..::..BadServerResponseExceptionThe expunge operation could not be completed. The message property of the exception contains the error message returned by the server.
System..::..ObjectDisposedExceptionThe ImapClient object has been disposed.
System.IO..::..IOExceptionThere was a failure writing to or reading from the network.
S22.Imap..::..NotAuthenticatedExceptionThe method was called in non-authenticated state, i.e. before logging in.

See Also