CancelAll Method

<< Click to Display Table of Contents >>

Navigation:  Reference > SmtpMail >

CancelAll Method

 

CancelAll method cancels sending of all messages that were queued for sending using SendAsync method.

 

Syntax

 

[Visual Basic]


Sub CancelAll()

 

Example:

 

objSmtpMail.CancelAll

 

[VBScript]


Sub CancelAll()

 

Example:

 

objSmtpMail.CancelAll

 

[C#]


void Cancel();

 

Example:

 

objSmtpMail.CancelAll();

 

[C++]


HRESULT CancelAll();

 

Example:

 

spSmtpMail->CancelAll();

 

 

Parameters

 

None.

 

Return value

 

None.

 

Remarks

 

SendAsync method places a message into a message queue and returns message number which identifies the message. Use CancelAll method to cancel sending of all messages that were not sent yet. Only messages that have status MailStatusQueued or MailStatusSending will be canceled. If a message is currently transferred and its status is MailStatusSending, CancelAll method doesn't cause the transfer to stop immediately. Message is marked for cancellation and will be canceled some time later. The message is actually canceled when its status changes to MailStatusCanceled.