Determines whether the specified capability is supported by the server.

Namespace: S22.Imap
Assembly: S22.Imap (in S22.Imap.dll) Version: 3.6.0.0 (3.6.0.0)

Syntax

C#
bool Supports(
	string capability
)

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

ExceptionCondition
System..::..ArgumentNullExceptionThe capability parameter is null.
S22.Imap..::..BadServerResponseExceptionAn unexpected response has been received from the server; The message property of the exception contains the error message returned by the server.
System.IO..::..IOExceptionThere was a failure writing to or reading from the network.
System..::..ObjectDisposedExceptionThe ImapClient object has been disposed.

See Also