Mail Service Class
An abstract mail service implementation.
Definition
Namespace: MailKit
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
Assembly: MailKit (in MailKit.dll) Version: 5.0.0
C#
public abstract class MailService : IMailService,
IDisposable, IAsyncDisposable- Inheritance
- Object MailService
- Derived
- Implements
- IMailService, IAsyncDisposable, IDisposable
Remarks
An abstract mail service implementation.
Constructors
| MailService | Initializes a new instance of the MailService class. |
| MailService(IProtocolLogger) | Initializes a new instance of the MailService class. |
Properties
| AuthenticationMechanisms | Gets the authentication mechanisms supported by the mail server. |
| CheckCertificateRevocation | Get or set whether connecting via SSL/TLS should check certificate revocation. |
| ClientCertificates | Get or set the client SSL certificates. |
| IsAuthenticated | Get whether or not the client is currently authenticated with the mail server. |
| IsConnected | Gets whether or not the client is currently connected to an mail server. |
| IsEncrypted | Get whether or not the connection is encrypted (typically via SSL or TLS). |
| IsSecure | Get whether or not the connection is secure (typically via SSL or TLS). |
| IsSigned | Get whether or not the connection is signed (typically via SSL or TLS). |
| LocalEndPoint | Get or set the local IP end point to use when connecting to the remote host. |
| Protocol | Get the protocol supported by the message service. |
| ProtocolLogger | Get the protocol logger. |
| ProxyClient | Get or set the proxy client to use when connecting to a remote host. |
| ServerCertificateValidationCallback | Get or set a callback function to validate the server certificate. |
| SslCipherSuite | Get the negotiated SSL or TLS cipher suite. |
| SslCipherSuitesPolicy | Get or set the cipher suites allowed to be used when negotiating an SSL or TLS connection. |
| SslProtocol | Get the negotiated SSL or TLS protocol version. |
| SslProtocols | Get or set the set of enabled SSL and/or TLS protocol versions that the client is allowed to use. |
| SyncRoot | Get an object that can be used to synchronize access to the service. |
| Timeout | Gets or sets the timeout for network streaming operations, in milliseconds. |
Methods
| Authenticate(ICredentials, CancellationToken) | Authenticate using the supplied credentials. |
| Authenticate(SaslMechanism, CancellationToken) | Authenticate using the specified SASL mechanism. |
| Authenticate(Encoding, ICredentials, CancellationToken) | Authenticate using the supplied credentials. |
| Authenticate(String, String, CancellationToken) | Authenticate using the specified user name and password. |
| Authenticate(Encoding, String, String, CancellationToken) | Authenticate using the specified user name and password. |
| AuthenticateAsync(ICredentials, CancellationToken) | Asynchronously authenticate using the supplied credentials. |
| AuthenticateAsync(SaslMechanism, CancellationToken) | Asynchronously authenticate using the specified SASL mechanism. |
| AuthenticateAsync(Encoding, ICredentials, CancellationToken) | Asynchronously authenticate using the supplied credentials. |
| AuthenticateAsync(String, String, CancellationToken) | Asynchronously authenticate using the specified user name and password. |
| AuthenticateAsync(Encoding, String, String, CancellationToken) | Asynchronously authenticate using the specified user name and password. |
| Connect(Uri, CancellationToken) | Establish a connection to the specified mail server. |
| Connect(String, Int32, SecureSocketOptions, CancellationToken) | Establish a connection to the specified mail server. |
| Connect(String, Int32, Boolean, CancellationToken) | Establish a connection to the specified mail server. |
| Connect(Socket, String, Int32, SecureSocketOptions, CancellationToken) | Establish a connection to the specified mail server using the provided socket. |
| Connect(Stream, String, Int32, SecureSocketOptions, CancellationToken) | Establish a connection to the specified mail server using the provided stream. |
| ConnectAsync(Uri, CancellationToken) | Asynchronously establish a connection to the specified mail server. |
| ConnectAsync(String, Int32, SecureSocketOptions, CancellationToken) | Asynchronously establish a connection to the specified mail server. |
| ConnectAsync(String, Int32, Boolean, CancellationToken) | Asynchronously establish a connection to the specified mail server. |
| ConnectAsync(Socket, String, Int32, SecureSocketOptions, CancellationToken) | Asynchronously establish a connection to the specified mail server using the provided socket. |
| ConnectAsync(Stream, String, Int32, SecureSocketOptions, CancellationToken) | Asynchronously establish a connection to the specified mail server using the provided stream. |
| DefaultServerCertificateValidationCallback | The default server certificate validation callback used when connecting via SSL or TLS. |
| Disconnect | Disconnect the service. |
| DisconnectAsync | Asynchronously disconnect the service. |
| Dispose | Releases all resource used by the MailService object. |
| Dispose(Boolean) | Releases the unmanaged resources used by the MailService and optionally releases the managed resources. |
| DisposeAsync | Asynchronously releases all resources used by the MailService object. |
| DisposeAsyncCore | Asynchronously releases the managed resources used by the 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.
(Overrides ObjectFinalize) |
| 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. |
| 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. |
| NoOpAsync | Asynchronously ping the mail server to keep the connection alive. |
| OnAuthenticated | Raise the authenticated event. |
| OnConnected | Raise the connected event. |
| OnDisconnected | Raise the disconnected event. |
| ToString | Returns a string that represents the current object. (Inherited from Object) |
Events
| Authenticated | Occurs when the client has been successfully authenticated. |
| Connected | Occurs when the client has been successfully connected. |
| Disconnected | Occurs when the client gets disconnected. |