Determines whether the specified capability is supported by the server.
Namespace: S22.ImapAssembly: S22.Imap (in S22.Imap.dll) Version: 3.6.0.0 (3.6.0.0)
Syntax
Parameters
- capability
- Type: System..::..String
The IMAP capability to probe for (for example "IDLE").
Return Value
true if the specified capability is supported by the server; Otherwise false.
Remarks
This method may be called in non-authenticated state.
Examples
This example demonstrates how to connect and login to an IMAP server.
CopyC#

// Connect to Gmail's IMAP server on port 993 using SSL. ImapClient Client = null; try { Client = new ImapClient("imap.gmail.com", 993, "My_Username", "My_Password", true, AuthMethod.Auto); // Check if the server supports IMAP IDLE. if(Client.Supports("IDLE")) Console.WriteLine("This server supports the IMAP4 IDLE specification"); else Console.WriteLine("This server does not support IMAP IDLE"); } catch(InvalidCredentialsException) { Console.WriteLine("The server rejected the supplied credentials"); } finally { // Release resources. if(Client != null) Client.Dispose(); }
Exceptions
Exception | Condition |
---|---|
System..::..ArgumentNullException | The capability parameter is null. |
S22.Imap..::..BadServerResponseException | An unexpected response has been received from the server; The message property of the exception contains the error message returned by the server. |
System.IO..::..IOException | There was a failure writing to or reading from the network. |
System..::..ObjectDisposedException | The ImapClient object has been disposed. |