SmtpClient.SendAsyncCancel Method ()

 

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

Namespace:   System.Net.Mail
Assembly:  System (in System.dll)

member SendAsyncCancel : unit -> unit

Exception Condition
ObjectDisposedException

This object has been disposed.

Use the SendAsyncCancel method to cancel a pending SendAsync operation. If there is mail waiting to be sent, this method releases resources used to store the mail. If there is no mail waiting to be sent, this method does nothing.

The following code example demonstrates sending an e-mail message asynchronously. The user has the option to cancel the mail if it has not been sent.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 2.0
Return to top
Show: