Flags the specified message for deletion from the server.
true if the message has been flagged for deletion; otherwise, false.
If more than one message is deleted, it's recommended to use DeleteMessages 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.
| Exception Type | Condition |
|---|---|
| MailBeeException | An error occurred and ThrowExceptions is true. |
This sample deletes the first message from a user account on a POP3 server.
[C#] // 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.DeleteMessage(1); pop.Disconnect();
[Visual Basic] ' To use the code below, import MailBee namespaces at the top of your code. Imports MailBee Imports MailBee.Pop3Mail ' The actual code (put it into a method of your class). Dim pop As New Pop3 pop.Connect("mail.domain.com") pop.Login("jdoe", "secret") pop.DeleteMessage(1) pop.Disconnect()
Pop3 Class | MailBee.Pop3Mail Namespace | DeleteMessages