Click or drag to resize
MimeKit

ImapClientIsConnected Property

Get whether or not the client is currently connected to an IMAP server.

Namespace:  MailKit.Net.Imap
Assembly:  MailKit (in MailKit.dll) Version: 2.10.0
Syntax
C#
public override bool IsConnected { get; }

Property Value

Type: Boolean
true if the client is connected; otherwise, false.

Implements

IMailServiceIsConnected
IMailServiceIsConnected
Remarks

The IsConnected state is set to true immediately after one of the Connect methods succeeds and is not set back to false until either the client is disconnected via Disconnect(Boolean, CancellationToken) or until an ImapProtocolException is thrown while attempting to read or write to the underlying network socket.

When an ImapProtocolException is caught, the connection state of the ImapClient should be checked before continuing.

See Also