System.Net.Mail.SmtpClient Members

The members of System.Net.Mail.SmtpClient are listed below.

See Also: Inherited members from System.Object

Public Constructors

Initializes a new instance of the System.Net.Mail.SmtpClient class by using configuration file settings.

Initializes a new instance of the System.Net.Mail.SmtpClient class that sends e-mail by using the specified SMTP server.

Initializes a new instance of the System.Net.Mail.SmtpClient class that sends e-mail by using the specified SMTP server and port.

Public Properties

[read-only]
ClientCertificatesSystem.Security.Cryptography.X509Certificates.X509CertificateCollection.

Specify which certificates should be used to establish the Secure Sockets Layer (SSL) connection.

CredentialsSystem.Net.ICredentialsByHost.

Gets or sets the credentials used to authenticate the sender.

DeliveryMethodSmtpDeliveryMethod.

Specifies how outgoing email messages will be handled.

EnableSslbool.

Specify whether the System.Net.Mail.SmtpClient uses Secure Sockets Layer (SSL) to encrypt the connection.

Hoststring.

Gets or sets the name or IP address of the host used for SMTP transactions.

PickupDirectoryLocationstring.

Gets or sets the folder where applications save mail messages to be processed by the local SMTP server.

Portint.

Gets or sets the port used for SMTP transactions.

[read-only]
ServicePointSystem.Net.ServicePoint.

Gets the network connection used to transmit the e-mail message.

TargetNamestring.

Gets or sets the Service Provider Name (SPN) to use for authentication when using extended protection.

Timeoutint.

Gets or sets a value that specifies the amount of time after which a synchronous erload:System.Net.Mail.SmtpClient.Send call times out.

UseDefaultCredentialsbool.

Gets or sets a bool value that controls whether the System.Net.CredentialCache.DefaultCredentials are sent with requests.

Public Methods

Dispose()

Sends a QUIT message to the SMTP server, gracefully ends the TCP connection, and releases all resources used by the current instance of the System.Net.Mail.SmtpClient class.

Send(MailMessage)

Sends the specified message to an SMTP server for delivery.

Send(string, string, string, string)

Sends the specified e-mail message to an SMTP server for delivery. The message sender, recipients, subject, and message body are specified using string objects.

SendAsync(MailMessage, object)

Sends the specified e-mail message to an SMTP server for delivery. This method does not block the calling thread and allows the caller to pass an object to the method that is invoked when the operation completes.

SendAsync(string, string, string, string, object)

Sends an e-mail message to an SMTP server for delivery. The message sender, recipients, subject, and message body are specified using string objects. This method does not block the calling thread and allows the caller to pass an object to the method that is invoked when the operation completes.

SendAsyncCancel()

Cancels an asynchronous operation to send an e-mail message.

Protected Methods

Dispose(bool)

Sends a QUIT message to the SMTP server, gracefully ends the TCP connection, releases all resources used by the current instance of the System.Net.Mail.SmtpClient class, and optionally disposes of the managed resources.

OnSendCompleted(System.ComponentModel.AsyncCompletedEventArgs)

Raises the SmtpClient.SendCompleted event.

Public Events

SendCompleted

Occurs when an asynchronous e-mail send operation completes.