You don't need to split up the emails in batches that way. By spooling them all to disk then dealing with the spool is a lot easier.
<cfdirectory action = "list" directory = "\CFusionMX\Mail\Undelivr\" name = "mail"> <cfoutput query ="mail"> <cffile action="move" source ="\CFusionMX\Mail\Undelivr\#mail.name#" destination="\CFusionMX\Mail\spool\"> </cfoutput> -----Original Message----- From: Bobby Hartsfield [mailto:[EMAIL PROTECTED] Sent: 03 September 2006 19:00 To: CF-Talk Subject: RE: mass emailing from CF You're right, it would create more possible points of failure but the only failure so far is timeouts from a remote user. It's way too fast locally to timeout so the chances of failure would really be less from what I can tell. As for deciding how many cfscchedules to make, that would be some pretty basic math. Something like this should do the trick... <cfset totalEmails = 10001 /> <cfset emailsPerBatch = 1000 /> <cfset totalBatches = round(totalEmails / emailsPerBatch) /> <cfif totalEmails MOD emailsPerBatch neq 0> <cfset totalBatches = totalBatches + 1 /> </cfif> Without testing... that SHOULD spit back 11 .....or just add the stragglers to the last batch. ...:.:.:.:.:.:.:.:.:.:.:.:. Bobby Hartsfield http://acoderslife.com -- No virus found in this outgoing message. Checked by AVG Free Edition. Version: 7.1.405 / Virus Database: 268.11.7/436 - Release Date: 01/09/2006 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Introducing the Fusion Authority Quarterly Update. 80 pages of hard-hitting, up-to-date ColdFusion information by your peers, delivered to your door four times a year. http://www.fusionauthority.com/quarterly Archive: http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:251923 Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4