MailBee.NET Objects 4.0

Imap.Disconnect Method 

Disconnects from the IMAP4 server and releases any used resources.

public bool Disconnect();

Return Value

true if the method succeeds; otherwise, false.

Remarks

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.

Exceptions

Exception Type Condition
MailBeeException An error occurred and ThrowExceptions is true.

Example

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()

See Also

Imap Class | MailBee.ImapMail Namespace