SmtpGetExtensions Method
Returns a reference to the key-value list of the server capabilities.

Namespace: MailBee.SmtpMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax
public StringDictionary GetExtensions()

Return Value

Type: StringDictionary
The key-value list of the server capabilities, or a null reference (Nothing in Visual Basic) if the capabilities list is not available.
Exceptions
ExceptionCondition
MailBeeInvalidStateExceptionThere are multiple or non-SMTP connections being opened at the moment (IsSmtpContext is false).
MailBeeExceptionAn error occurred and ThrowExceptions is true.
Remarks
In order to use this method, the connection with the SMTP server must already be established, and Hello method already called.
Note Note
If the server does not support EHLO command (i.e. the server is not ESMTP enabled), the capabilities list will not be available.

In the returned StringDictionary, each key is a capability name (always lowercase). Its value is either empty string (if the capability has no parameters) or space-delimited list of the parameters.

Examples
This sample displays the list of all capabilities supported by the server.
// To use the code below, import these namespaces at the top of your code.
using System;
using MailBee;
using MailBee.SmtpMail;

// The actual code (put it into a method of your class)

Smtp mailer = new Smtp();
mailer.SmtpServers.Add("mail.domain.com");
mailer.Connect();
mailer.Hello();
System.Collections.Specialized.StringDictionary caps = mailer.GetExtensions();
if (caps == null)
{
    Console.WriteLine("The given SMTP server does not support any ESMTP extensions");
}
else
{
    foreach (string cap in caps.Keys)
    {
        string val = caps[cap];
        if (val != string.Empty)
        {
            // Print capability name and parameters.
            Console.WriteLine(cap + " " + val);
        }
        else
        {
            // For parameterless capabilities, print capability name only.
            Console.WriteLine(cap);
        }
    }
}
mailer.Disconnect();

// The output (the actual content will be different for a particular mail server)
dsn
size
auth LOGIN PLAIN
ehlo
auth=login
starttls
help
pipelining

In the output above, only "auth" capability has parameters.
Note: auth=login is a single name, while "auth LOGIN PLAIN" denotes auth
capability having two parameters (LOGIN and PLAIN).
See Also