Was this page helpful?
Your feedback about this content is important. Let us know what you think.
Additional feedback?
1500 characters remaining
SendAsyncCancel Method
Collapse the table of content
Expand the table of content

SmtpClient.SendAsyncCancel Method

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

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

'Declaration
Public Sub SendAsyncCancel
'Usage
Dim instance As SmtpClient

instance.SendAsyncCancel
public void SendAsyncCancel ()
public function SendAsyncCancel ()
Not applicable.

Exception typeCondition

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.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0, 2.0

Community Additions

ADD
Show:
© 2015 Microsoft