MailTransport Class

An abstract mail transport implementation.

Definition

Namespace: MailKit
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
public abstract class MailTransport : MailService, 
	IMailTransport, IMailService, IDisposable, IAsyncDisposable
Inheritance
Object    MailService    MailTransport
Derived
Implements
IMailService, IMailTransport, IAsyncDisposable, IDisposable

Remarks

An abstract mail transport implementation.

Constructors

MailTransport Initializes a new instance of the MailTransport class.

Properties

AuthenticationMechanisms Gets the authentication mechanisms supported by the mail server.
(Inherited from MailService)
CheckCertificateRevocation Get or set whether connecting via SSL/TLS should check certificate revocation.
(Inherited from MailService)
ClientCertificates Get or set the client SSL certificates.
(Inherited from MailService)
IsAuthenticated Get whether or not the client is currently authenticated with the mail server.
(Inherited from MailService)
IsConnected Gets whether or not the client is currently connected to an mail server.
(Inherited from MailService)
IsEncrypted Get whether or not the connection is encrypted (typically via SSL or TLS).
(Inherited from MailService)
IsSecure Get whether or not the connection is secure (typically via SSL or TLS).
(Inherited from MailService)
IsSigned Get whether or not the connection is signed (typically via SSL or TLS).
(Inherited from MailService)
LocalEndPoint Get or set the local IP end point to use when connecting to the remote host.
(Inherited from MailService)
Protocol Get the protocol supported by the message service.
(Inherited from MailService)
ProtocolLogger Get the protocol logger.
(Inherited from MailService)
ProxyClient Get or set the proxy client to use when connecting to a remote host.
(Inherited from MailService)
ServerCertificateValidationCallback Get or set a callback function to validate the server certificate.
(Inherited from MailService)
SslCipherSuite Get the negotiated SSL or TLS cipher suite.
(Inherited from MailService)
SslCipherSuitesPolicy Get or set the cipher suites allowed to be used when negotiating an SSL or TLS connection.
(Inherited from MailService)
SslProtocol Get the negotiated SSL or TLS protocol version.
(Inherited from MailService)
SslProtocols Get or set the set of enabled SSL and/or TLS protocol versions that the client is allowed to use.
(Inherited from MailService)
SyncRoot Get an object that can be used to synchronize access to the service.
(Inherited from MailService)
Timeout Gets or sets the timeout for network streaming operations, in milliseconds.
(Inherited from MailService)

Methods

Authenticate(ICredentials, CancellationToken) Authenticate using the supplied credentials.
(Inherited from MailService)
Authenticate(SaslMechanism, CancellationToken) Authenticate using the specified SASL mechanism.
(Inherited from MailService)
Authenticate(Encoding, ICredentials, CancellationToken) Authenticate using the supplied credentials.
(Inherited from MailService)
Authenticate(String, String, CancellationToken) Authenticate using the specified user name and password.
(Inherited from MailService)
Authenticate(Encoding, String, String, CancellationToken) Authenticate using the specified user name and password.
(Inherited from MailService)
AuthenticateAsync(ICredentials, CancellationToken) Asynchronously authenticate using the supplied credentials.
(Inherited from MailService)
AuthenticateAsync(SaslMechanism, CancellationToken) Asynchronously authenticate using the specified SASL mechanism.
(Inherited from MailService)
AuthenticateAsync(Encoding, ICredentials, CancellationToken) Asynchronously authenticate using the supplied credentials.
(Inherited from MailService)
AuthenticateAsync(String, String, CancellationToken) Asynchronously authenticate using the specified user name and password.
(Inherited from MailService)
AuthenticateAsync(Encoding, String, String, CancellationToken) Asynchronously authenticate using the specified user name and password.
(Inherited from MailService)
Connect(Uri, CancellationToken) Establish a connection to the specified mail server.
(Inherited from MailService)
Connect(String, Int32, SecureSocketOptions, CancellationToken) Establish a connection to the specified mail server.
(Inherited from MailService)
Connect(String, Int32, Boolean, CancellationToken) Establish a connection to the specified mail server.
(Inherited from MailService)
Connect(Socket, String, Int32, SecureSocketOptions, CancellationToken) Establish a connection to the specified mail server using the provided socket.
(Inherited from MailService)
Connect(Stream, String, Int32, SecureSocketOptions, CancellationToken) Establish a connection to the specified mail server using the provided stream.
(Inherited from MailService)
ConnectAsync(Uri, CancellationToken) Asynchronously establish a connection to the specified mail server.
(Inherited from MailService)
ConnectAsync(String, Int32, SecureSocketOptions, CancellationToken) Asynchronously establish a connection to the specified mail server.
(Inherited from MailService)
ConnectAsync(String, Int32, Boolean, CancellationToken) Asynchronously establish a connection to the specified mail server.
(Inherited from MailService)
ConnectAsync(Socket, String, Int32, SecureSocketOptions, CancellationToken) Asynchronously establish a connection to the specified mail server using the provided socket.
(Inherited from MailService)
ConnectAsync(Stream, String, Int32, SecureSocketOptions, CancellationToken) Asynchronously establish a connection to the specified mail server using the provided stream.
(Inherited from MailService)
Disconnect Disconnect the service.
(Inherited from MailService)
DisconnectAsync Asynchronously disconnect the service.
(Inherited from MailService)
Dispose Releases all resource used by the MailService object.
(Inherited from MailService)
Dispose(Boolean) Releases the unmanaged resources used by the MailService and optionally releases the managed resources.
(Inherited from MailService)
DisposeAsync Asynchronously releases all resources used by the MailService object.
(Inherited from MailService)
DisposeAsyncCore Asynchronously releases the managed resources used by the MailService.
(Inherited from MailService)
Equals Determines whether the specified object is equal to the current object.
(Inherited from Object)
Finalize Releases unmanaged resources and performs other cleanup operations before the MailService is reclaimed by garbage collection.
(Inherited from MailService)
GetHashCode Serves as the default hash function.
(Inherited from Object)
GetSslClientAuthenticationOptions Gets the SSL/TLS client authentication options for use with .NET5's SslStream.AuthenticateAsClient() API.
(Inherited from MailService)
GetType Gets the Type of the current instance.
(Inherited from Object)
MemberwiseClone Creates a shallow copy of the current Object.
(Inherited from Object)
NoOp Ping the mail server to keep the connection alive.
(Inherited from MailService)
NoOpAsync Asynchronously ping the mail server to keep the connection alive.
(Inherited from MailService)
OnAuthenticated Raise the authenticated event.
(Inherited from MailService)
OnConnected Raise the connected event.
(Inherited from MailService)
OnDisconnected Raise the disconnected event.
(Inherited from MailService)
OnMessageSent Raise the message sent event.
Send(ISendRequest, CancellationToken) Send a message.
Send(FormatOptions, ISendRequest, CancellationToken) Send a message.
SendAsync(ISendRequest, CancellationToken) Asynchronously send a message.
SendAsync(FormatOptions, ISendRequest, CancellationToken) Asynchronously send a message.
ToString Returns a string that represents the current object.
(Inherited from Object)

Events

Authenticated Occurs when the client has been successfully authenticated.
(Inherited from MailService)
Connected Occurs when the client has been successfully connected.
(Inherited from MailService)
Disconnected Occurs when the client gets disconnected.
(Inherited from MailService)
MessageSent Occurs when a message is successfully sent via the transport.

Extension Methods

Send Send the specified message.
(Defined by IMailTransportExtensions)
Send Send the specified message.
(Defined by IMailTransportExtensions)
Send Send the specified message using the supplied sender and recipients.
(Defined by IMailTransportExtensions)
Send Send the specified message using the supplied sender and recipients.
(Defined by IMailTransportExtensions)
SendAsync Asynchronously send the specified message.
(Defined by IMailTransportExtensions)
SendAsync Asynchronously send the specified message.
(Defined by IMailTransportExtensions)
SendAsync Asynchronously send the specified message using the supplied sender and recipients.
(Defined by IMailTransportExtensions)
SendAsync Asynchronously send the specified message using the supplied sender and recipients.
(Defined by IMailTransportExtensions)

See Also

Reference