• DR-IT Software
  • Products
  • Documentation
  • Product page
  • Examples
  • API reference
  • Support
Show / Hide Table of Contents

Class SmtpClientOptions

Configuration for SmtpClient. Mutable during construction; set all properties before calling Connect().

Inheritance
object
SmtpClientOptions
Inherited Members
object.ToString()
object.Equals(object)
object.Equals(object, object)
object.ReferenceEquals(object, object)
object.GetHashCode()
object.GetType()
Namespace: DRIT.Mail.Rfc.Smtp
Assembly: DRIT.Mail.dll
Syntax
public sealed class SmtpClientOptions

Constructors

View Source

SmtpClientOptions(string, int)

Initializes a new instance of the SmtpClientOptions class.

Declaration
public SmtpClientOptions(string host, int port)
Parameters
Type Name Description
string host

The SMTP server hostname.

int port

The SMTP server port (25, 587, or 465).

Properties

View Source

AutoAuthenticate

Gets or sets a value indicating whether Connect() should automatically authenticate after connecting. Default is true.

Declaration
public bool AutoAuthenticate { get; set; }
Property Value
Type Description
bool
View Source

AutoConnect

Gets or sets a value indicating whether Send(MimeMessage) should automatically connect if not already connected. Default is true.

Declaration
public bool AutoConnect { get; set; }
Property Value
Type Description
bool
View Source

CertificateValidationCallback

Gets or sets a custom SSL certificate validation callback, or null to use the platform default chain validation.

Declaration
public RemoteCertificateValidationCallback? CertificateValidationCallback { get; set; }
Property Value
Type Description
RemoteCertificateValidationCallback
View Source

ClientDomain

Gets or sets the client domain name sent in the EHLO/HELO greeting. If null, MachineName is used.

Declaration
public string? ClientDomain { get; set; }
Property Value
Type Description
string
View Source

Credentials

Gets or sets the credentials for SMTP authentication, or null to skip authentication.

Declaration
public SmtpCredentials? Credentials { get; set; }
Property Value
Type Description
SmtpCredentials
View Source

Host

Gets the SMTP server hostname.

Declaration
public string Host { get; }
Property Value
Type Description
string
View Source

MaxRecipientsPerMessage

Gets or sets the maximum number of recipients per message.

Default is 100.

Declaration
public int MaxRecipientsPerMessage { get; set; }
Property Value
Type Description
int
View Source

OAuth2Token

Gets or sets the OAuth 2.0 access token for XOAUTH2 authentication, or null to use password-based credentials. When set, this takes precedence over Credentials for mechanism selection.

Declaration
public SmtpOAuth2Token? OAuth2Token { get; set; }
Property Value
Type Description
SmtpOAuth2Token
View Source

Port

Gets the SMTP server port.

Declaration
public int Port { get; }
Property Value
Type Description
int
View Source

PreferredAuth

Gets or sets the preferred authentication mechanism. Default is Auto.

Declaration
public SmtpAuthenticationMechanism PreferredAuth { get; set; }
Property Value
Type Description
SmtpAuthenticationMechanism
View Source

RequireEncryption

Gets or sets a value indicating whether authentication is refused over an unencrypted connection. Default is false.

Declaration
public bool RequireEncryption { get; set; }
Property Value
Type Description
bool
View Source

SslMode

Gets or sets the TLS mode. Default is Auto.

Declaration
public SmtpSslMode SslMode { get; set; }
Property Value
Type Description
SmtpSslMode
View Source

Timeout

Gets or sets the timeout for connect, read, and write operations. Default is 30 seconds.

Declaration
public TimeSpan Timeout { get; set; }
Property Value
Type Description
TimeSpan
View Source

UsePipelining

Gets or sets a value indicating whether to use pipelining when the server supports it. Default is true.

Declaration
public bool UsePipelining { get; set; }
Property Value
Type Description
bool
  • View Source
Back to top

DR-IT Software documentation

DR-IT Software · Products · Documentation index · Product page · Downloads · Support · Licensing

Generated by DocFX