Mail ServiceIs Connected Property
Gets whether or not the client is currently connected to an mail server.
Definition
Namespace: MailKit
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
if the client is connected; otherwise, .
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
public abstract bool IsConnected { get; }Property Value
Booleanif the client is connected; otherwise, .
Implements
IMailServiceIsConnectedRemarks
The IsConnected state is set to immediately after one of the Connect methods succeeds and is not set back to until either the client is disconnected via Disconnect(Boolean, CancellationToken) or until a ProtocolException is thrown while attempting to read or write to the underlying network socket.
When an ProtocolException is caught, the connection state of the MailService should be checked before continuing.