MailBee.NET Objects 4.0

Pop3.GetExtension Method 

Returns the name or parameters of the specified POP3 capability.

public string GetExtension(
   string name
);

Parameters

name
The name of the capability.

Return Value

If the specified capability is parameterless, the return value is the name of the capability itself. If the capability has parameters, the return value is a string which contains the parameters list as returned by the server. If the server does not support CAPA command (see GetExtensions for more information) or the given capability is not supported, the return value is a null reference (Nothing in Visual Basic).

Remarks

The POP3 server (if supports CAPA command) always returns the list of all capabilities at once. Thus, all subsequent calls to GetExtension, GetExtensions, or GetExtensionValue methods will use the cached version of the capability data, and no round-trips to the server will be made.

Exceptions

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

Example

This sample displays whether the server supports POP3 pipelining.

[C#]
// To use the code below, import MailBee namespaces at the top of your code
using MailBee;
using MailBee.Pop3Mail;

// The actual code (put it into a method of your class)
Pop3 pop = new Pop3();
pop.Connect("mail.domain.com");
string ext = pop.GetExtension("pipelining");
if (ext == null)
{
    Console.WriteLine("The given POP3 server does not support pipelining");
}
else
{
    Console.WriteLine("Pipelining is supported");
}
pop.Disconnect();
[Visual Basic]
' To use the code below, import MailBee namespaces at the top of your code
Imports MailBee
Imports MailBee.Pop3Mail

' The actual code (put it into a method of your class)
Dim pop As New Pop3
pop.Connect("mail.domain.com")
Dim ext As String
ext = pop.GetExtension("pipelining")
If ext Is Nothing Then
    Console.WriteLine("The given POP3 server does not support pipelining")
Else
    Console.WriteLine("Pipelining is supported")
End If
pop.Disconnect()

See Also

Pop3 Class | MailBee.Pop3Mail Namespace