Disconnects from the IMAP4 server and releases any used resources.
true if the method succeeds; otherwise, false.
Unlike POP3, where all the messages marked as deleted are expunged when Disconnect method is called, the IMAP4 protocol requires the client to explicitly expunge messages marked as deleted using Close or Expunge method call.
| Exception Type | Condition |
|---|---|
| MailBeeException | An error occurred and ThrowExceptions is true. |
This sample connects to the IMAP4 server and then disconnects.
[C#] // To use the code below, import MailBee namespaces at the top of your code. using MailBee; using MailBee.ImapMail; // The actual code (put it into a method of your class). Imap imp = new Imap(); imp.Connect("mail.domain.com"); imp.Disconnect();
[Visual Basic] ' To use the code below, import MailBee namespaces at the top of your code. Imports MailBee Imports MailBee.ImapMail ' The actual code (put it into a method of your class). Dim imp As New Imap imp.Connect("mail.domain.com") imp.Disconnect()
Imap Class | MailBee.ImapMail Namespace