MailBee.NET Objects 4.0

Imap.GetExtension Method 

Returns the name of the specified IMAP4 capability if it's supported by the mail server.

public string GetExtension(
   string name
);

Parameters

name
The name of the capability.

Return Value

If the specified capability is supported, the return value is the lowercased name of the capability. If the given capability is not supported, the return value is a null reference (Nothing in Visual Basic).

Remarks

You should already be connected to the IMAP4 server in order to use this method.

Exceptions

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

Example

This sample displays whether the server supports UIDPLUS capability.

[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");
string ext = imp.GetExtension("UIDPLUS");
if (ext == null)
{
    Console.WriteLine("The given IMAP4 server does not support UIDPLUS");
}
else
{
    Console.WriteLine("UIDPLUS is supported");
}
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")
Dim ext As String = imp.GetExtension("UIDPLUS")
If ext Is Nothing Then
    Console.WriteLine("The given IMAP4 server does not support UIDPLUS")
Else
    Console.WriteLine("UIDPLUS is supported")
End If
imp.Disconnect()

See Also

Imap Class | MailBee.ImapMail Namespace