SmtpGetExtension Method
Returns the name or parameters of the specified ESMTP capability.

Namespace: MailBee.SmtpMail
Assembly: MailBee.NET (in MailBee.NET.dll) Version: 12.2.0 build 630 for .NET 4.5
public string GetExtension(
	string name


Type: SystemString
The name of the capability. This name is case-insensitive, e.g. pipelining and PIPELINING mean the same.

Return Value

Type: String
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 ESMTP (see GetExtensions for more information) or the given capability is not supported, the return value is a null reference (Nothing in Visual Basic).
MailBeeInvalidStateExceptionThere are multiple or non-SMTP connections being opened at the moment (IsSmtpContext is false).
MailBeeExceptionAn error occurred and ThrowExceptions is true.
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 will not be available.
This sample displays whether the server supports ESMTP pipelining.
// 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();
string ext = mailer.GetExtension("pipelining");
if (ext == null)
    Console.WriteLine("The given server does not support ESMTP pipelining");
    Console.WriteLine("ESMTP Pipelining is supported");
See Also