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.
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.