Pop3DeleteMessages Method (Int32, Int32)
Flags the specified range of messages for deletion from the server.

Namespace: MailBee.Pop3Mail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 11.2.0 build 590 for .NET 4.5
Syntax
public bool DeleteMessages(
	int startIndex,
	int count
)

Parameters

startIndex
Type: SystemInt32
The ordinal position (in the inbox) of the first message in the range being deleted.
count
Type: SystemInt32
Number of messages to be flagged for deletion, or -1 to indicate that all messages in the range startIndex to InboxMessageCount must be flagged for deletion.

Return Value

Type: Boolean
true if the messages have been flagged for deletion or count is 0; otherwise, false.
Exceptions
ExceptionCondition
MailBeeExceptionAn error occurred and ThrowExceptions is true.
Remarks
If the POP3 server supports pipelining, this method will flag all the messages in the specified range in a single network operation, which greatly increases performance and reduces network traffic.
Note Note
Messages flagged for deletion are actually removed from the server on Disconnect method call. Until this moment, the developer can remove the deletion status for all messages flagged as deleted by calling ResetDeletes method.
Examples
This sample deletes all the messages in the inbox starting at message #10. The messages in the range from 1 to 9 are not affected.
// To use the code below, import MailBee namespaces at the top of your code.
using MailBee;
using MailBee.Pop3Mail;

// The actual code (put it into a method of your class).
Pop3 pop = new Pop3();
pop.Connect("mail.domain.com");
pop.Login("jdoe", "secret");
pop.DeleteMessages(10, -1);
pop.Disconnect();
See Also