Returns the name or parameters of the specified ESMTP capability.
Namespace: MailBee.SmtpMailAssembly: MailBee.NET (in MailBee.NET.dll) Version: 12.5.0 build 687 for .NET 4.5
Syntax public string GetExtension(
string name
)
Public Function GetExtension (
name As String
) As String
Parameters
- name
- Type: SystemString
The name of the capability. This name is case-insensitive, e.g. pipelining and PIPELINING mean the same.
Return Value
Type:
StringIf 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 ESMTP (see
GetExtensions for
more information) or the given capability is not supported, the return value is a
null reference (
Nothing in Visual Basic).
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 will not be available. |
Examples This sample displays whether the server supports ESMTP pipelining.
using System;
using MailBee;
using MailBee.SmtpMail;
Smtp mailer = new Smtp();
mailer.SmtpServers.Add("mail.domain.com");
mailer.Connect();
mailer.Hello();
string ext = mailer.GetExtension("pipelining");
if (ext == null)
{
Console.WriteLine("The given server does not support ESMTP pipelining");
}
else
{
Console.WriteLine("ESMTP Pipelining is supported");
}
mailer.Disconnect();
Imports MailBee
Imports MailBee.SmtpMail
Dim mailer = New Smtp
mailer.SmtpServers.Add("mail.domain.com")
mailer.Connect()
mailer.Hello()
Dim ext As String = mailer.GetExtension("pipelining")
If ext Is Nothing Then
Console.WriteLine("The given server does not support ESMTP pipelining")
Else
Console.WriteLine("ESMTP Pipelining is supported")
End If
mailer.Disconnect()
See Also