System.Net.Mail.SmtpClient.Timeout Property

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

Syntax

public int Timeout { get; set; }

Value

Documentation for this section has not yet been entered.

Remarks

By default, calls to the erload:System.Net.Mail.SmtpClient.Send method block until the operation completes. If you set the SmtpClient.Timeout property to a positive value, and a erload:System.Net.Mail.SmtpClient.Send operation cannot complete in the allotted time, the System.Net.Mail.SmtpClient class throws an System.Net.Mail.SmtpException exception.

To send a message and continue executing in the application thread, use the erload:System.Net.Mail.SmtpClient.SendAsync method.

Requirements

Namespace: System.Net.Mail
Assembly: System (in System.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0