Skip navigation
SarasotaTim
Currently Being Moderated

How can I put a timed pause between CFMAIL sendouts?

Aug 2, 2012 8:50 AM

Tags: #email #pause #batch #cfquery #cfmail #timer #cf8 #cfthread #mailing

A preface, this is not marketing e-mailing I'm discussing, it's already opted-in government notifications requested by the customers.

 

This is driving me absolutely crazy.  I've got a working SQL query that pulls a number or records (e-mail addresses), then sends out a series of mailings in batches (still working on that part).

 

What I'm stuck on is how in the world can I pause the CFMAIL processings between batches?  For example, I want to send 500 e-mails, pause for 10 minutes, send the next 500, etc.

 

CFTHREAD looks kinda like what I might need but I'm not sure.

 

We're afraid of sending all at once (probably no more than 5,000 to 10,000 total) in fear of being blacklisted.  Usually this app will only send 100 to 500 at a time.

 

Thanks in advance for any help you guys can give!

 

This is for CF8, incidentally.

 

T

 
Replies
  • Currently Being Moderated
    Aug 2, 2012 9:06 AM   in reply to SarasotaTim

    cfsleep

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 2, 2012 9:51 AM   in reply to SarasotaTim

    I think CFSLEEP was an old custom tag.  Just use the sleep() function.

    -reed

     
    |
    Mark as:
  • Currently Being Moderated
    Aug 3, 2012 3:14 AM   in reply to SarasotaTim

    I've developed a mailing application like this for our own (used for sending up to 100k emails per job so far without a problem) and my solution was this (simplified):

     

    1) set-up a CFusion cronjob that runs every X minutes and executes the following

    2) select all records/email-addresses within the sql query (no maxrows parameter)

    3) cfloop over this query result-set with startrow and endrow parameter to select just the desired number of addresses

    4) stored endrow value in database and used this one as startrow param for the next run/loop, X minutes later... and so on

     

    I do not think that using cfsleep is wise, as such mailingjobs could potientially run for hours if not days, and you don't want to let scripts run this long.

    First they occupy one of the precious "max parallel cf threads" slots on your server and second you could potentially loose all progress of this task if your server ever restarts while this script is running.

     
    |
    Mark as:

More Like This

  • Retrieving data ...

Bookmarked By (0)

Answers + Points = Status

  • 10 points awarded for Correct Answers
  • 5 points awarded for Helpful Answers
  • 10,000+ points
  • 1,001-10,000 points
  • 501-1,000 points
  • 5-500 points