Class SmtpServerCapabilities
Extensions advertised by the server in its EHLO response. Immutable. Populated by Parse(SmtpResponse) from the EHLO reply.
Inherited Members
Namespace: DRIT.Mail.Rfc.Smtp
Assembly: DRIT.Mail.dll
Syntax
public sealed class SmtpServerCapabilities
Constructors
View SourceSmtpServerCapabilities(bool, bool, bool, bool, bool, long?, IReadOnlyCollection<string>, string)
Initializes a new instance of the SmtpServerCapabilities class.
Declaration
public SmtpServerCapabilities(bool supportsPipelining, bool supportsStartTls, bool supportsEightBitMime, bool supportsSmtpUtf8, bool supportsEnhancedStatusCodes, long? maxMessageSize, IReadOnlyCollection<string> authMechanisms, string serverName)
Parameters
| Type | Name | Description |
|---|---|---|
| bool | supportsPipelining | |
| bool | supportsStartTls | |
| bool | supportsEightBitMime | |
| bool | supportsSmtpUtf8 | |
| bool | supportsEnhancedStatusCodes | |
| long? | maxMessageSize | |
| IReadOnlyCollection<string> | authMechanisms | |
| string | serverName |
Properties
View SourceAuthMechanisms
Gets the SASL authentication mechanisms advertised by the server (AUTH extension, RFC 4954), upper-cased. Empty if the server does not advertise AUTH.
Declaration
public IReadOnlyCollection<string> AuthMechanisms { get; }
Property Value
| Type | Description |
|---|---|
| IReadOnlyCollection<string> |
Empty
Gets an empty capabilities instance, used before the EHLO response has been received or when the server falls back to HELO.
Declaration
public static SmtpServerCapabilities Empty { get; }
Property Value
| Type | Description |
|---|---|
| SmtpServerCapabilities |
MaxMessageSize
Gets the maximum message size in bytes advertised by the server (SIZE extension, RFC 1870), or null if the server did not advertise a limit.
Declaration
public long? MaxMessageSize { get; }
Property Value
| Type | Description |
|---|---|
| long? |
ServerName
Gets the server name extracted from the first line of the EHLO response (typically the server's hostname).
Declaration
public string ServerName { get; }
Property Value
| Type | Description |
|---|---|
| string |
SupportsEightBitMime
Gets a value indicating whether the server supports the 8BITMIME extension (RFC 1652).
Declaration
public bool SupportsEightBitMime { get; }
Property Value
| Type | Description |
|---|---|
| bool |
SupportsEnhancedStatusCodes
Gets a value indicating whether the server supports the ENHANCEDSTATUSCODES extension (RFC 3463).
Declaration
public bool SupportsEnhancedStatusCodes { get; }
Property Value
| Type | Description |
|---|---|
| bool |
SupportsPipelining
Gets a value indicating whether the server supports the PIPELINING extension (RFC 2920).
Declaration
public bool SupportsPipelining { get; }
Property Value
| Type | Description |
|---|---|
| bool |
SupportsSmtpUtf8
Gets a value indicating whether the server supports the SMTPUTF8 extension (RFC 6531).
Declaration
public bool SupportsSmtpUtf8 { get; }
Property Value
| Type | Description |
|---|---|
| bool |
SupportsStartTls
Gets a value indicating whether the server supports the STARTTLS extension (RFC 3207).
Declaration
public bool SupportsStartTls { get; }
Property Value
| Type | Description |
|---|---|
| bool |
Methods
View SourceParse(SmtpResponse)
Parses an EHLO response into an SmtpServerCapabilities instance.
Declaration
public static SmtpServerCapabilities Parse(SmtpResponse ehloResponse)
Parameters
| Type | Name | Description |
|---|---|---|
| SmtpResponse | ehloResponse | The positive EHLO reply. |
Returns
| Type | Description |
|---|---|
| SmtpServerCapabilities | The parsed capabilities. |
Exceptions
| Type | Condition |
|---|---|
| ArgumentNullException | Thrown if |