DeleteScheduledMessages

The DeleteScheduledMessages method removes pending queued messages based on email address, subject and/or x-header (available in Version 2.0 and above).

Useful if a user changes status (eg from trial to paid-customer) and you need to remove future messages that assume the old status.

DeleteScheduledMessagesEx method (available in 3.1c and above, 11/17/00) duplicates DeleteScheduledMessages except that it only looks at files containing the email address, greatly speeding searches on a spool directory with a large number of email addresses.

Tip:
If you create a set of followup emails for a particular followup campaign, and mark each with the same x-header, the x-header field can be used to delete the entire campaign for this email address, regardless of subject.

Syntax

DeleteScheduledMessages(email, subject, x-header, x-header-value)

Parameters

email
Specifies all messages that match this email address ("*" for match any)
subject
Specifies all messages that match this subject ("*" for match any)
X-header
Specifies all messages that contain this X-header ("*" for match any)
X-header-value
If X-header is specified, then the value to of the X-Header to match.

Return Values

Returns the number of messages deleted.

Examples

The following deletes all scheduled messages to a specific email address.


<% 
Set mailer = Server.CreateObject("ocxQmail.ocxQmailCtrl.1") 

numDeleted = mailer.DeleteScheduledMessages("uninterested@lethargy.com", "*", "*", "")

response.Write(numDeleted & " messages deleted")

%>

The following deletes all scheduled messages to a specific email address with an XHeader of "X-PostFollowup1", with a value of "UniversalWidget"


<% 
Set mailer = Server.CreateObject("ocxQmail.ocxQmailCtrl.1") 

numDeleted = mailer.DeleteScheduledMessages("enthusiastic@paidforit.com", "*", "X-PostFollowup1", "UniversalWidgetTrial")

response.Write(numDeleted & " messages deleted")

%>

Applies To

ocxQmail ASP Component