Disconnects from the POP3 server and releases any used resources.
true if the method succeeds; otherwise, false.
On successful completion of this method, all the messages marked as deleted during the POP3 session are physically deleted by the server. If this method fails, the connection is still closed and all network resources are freed, but it's undefined whether the messages marked for deletion were really deleted or not.
| Exception Type | Condition |
|---|---|
| MailBeeException | An error occurred and ThrowExceptions is true. |
This sample deletes the first message in the inbox.
[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