Deletes the mail messages with the specified UIDs.

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

Syntax

C#
void DeleteMessages(
	IEnumerable<uint> uids,
	string mailbox = null
)

Parameters

uids
Type: System.Collections.Generic..::..IEnumerable<(Of <(<'UInt32>)>)>
An enumerable collection of UIDs of the mail messages to delete.
mailbox (Optional)
Type: System..::..String
The mailbox the messages will be deleted from. If this parameter is omitted, the value of the DefaultMailbox property is used to determine the mailbox to operate on.

Remarks

When deleting many messages, this method is more efficient than calling DeleteMessage(UInt32, String) for each individual message.

Exceptions

ExceptionCondition
System..::..ArgumentNullExceptionThe uids parameter is null.
System..::..ArgumentExceptionThe specified collection of UIDs is empty.
S22.Imap..::..BadServerResponseExceptionThe mail messages could not be deleted. 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