Flags the specified message for deletion from the server.
Namespace: MailBee.Pop3MailAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public bool DeleteMessage(
int index
)
Public Function DeleteMessage (
index As Integer
) As Boolean
Parameters
- index
- Type: SystemInt32
The ordinal position of the message in the inbox.
It must be in the range from 1 to InboxMessageCount.
Can be negative in the range from -1 to -InboxMessageCount, i.e. -1 denotes the last e-mail in the inbox.
Return Value
Type:
Booleantrue if the message has been flagged for deletion; otherwise,
false.
Exceptions Remarks
If more than one message is deleted, it's recommended to use
DeleteMessages(Int32, Int32)
method when possible, since it can operate much faster if the server
supports pipelining.
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 the first message from a user account on a POP3 server.
using MailBee;
using MailBee.Pop3Mail;
Pop3 pop = new Pop3();
pop.Connect("mail.domain.com");
pop.Login("jdoe", "secret");
pop.DeleteMessage(1);
pop.Disconnect();
Imports MailBee
Imports MailBee.Pop3Mail
Dim pop As New Pop3
pop.Connect("mail.domain.com")
pop.Login("jdoe", "secret")
pop.DeleteMessage(1)
pop.Disconnect()
See Also