Returns a reference to the key-value list of the server capabilities.
Namespace: MailBee.SmtpMailAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public StringDictionary GetExtensions()
Public Function GetExtensions As StringDictionary
Return Value
Type:
StringDictionaryThe key-value list of the server capabilities, or a null reference
(
Nothing in Visual Basic) if the capabilities list is not available.
Exceptions Remarks
In order to use this method, the connection with the SMTP server must already
be established, and
Hello method already called.
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.
using System;
using MailBee;
using MailBee.SmtpMail;
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)
{
Console.WriteLine(cap + " " + val);
}
else
{
Console.WriteLine(cap);
}
}
}
mailer.Disconnect();
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).
Imports MailBee
Imports MailBee.SmtpMail
Dim mailer = New Smtp
mailer.SmtpServers.Add("mail.domain.com")
mailer.Connect()
mailer.Hello()
Dim caps As System.Collections.Specialized.StringDictionary = mailer.GetExtensions()
If caps Is Nothing Then
Console.WriteLine("The given SMTP server does not support any ESMTP extensions")
Else
For Each cap As String In caps.Keys
Dim val As String = caps(cap)
If (val <> String.Empty) Then
Console.WriteLine(cap + " " + val)
Else
Console.WriteLine(cap)
End If
Next
End If
mailer.Disconnect()
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