I've just used a scheduled task with the long running template override set
on it.   Had one running over a hour before that was moshing out 20k emails
at night without a hiccup, no pauses in processing at all.  Took so long
because each email required a particular long SQL query to execute, darn
complex sales data.  Didn't have CFTHREAD then or would have knocked it to
the threaded curb for sure.


Douglas Knudsen
http://www.cubicleman.com
this is my signature, like it?


On Thu, May 21, 2009 at 5:30 PM, Dawn Hoagland <dawnhoagl...@gmail.com>wrote:

> I've successfully used a meta-refresh with a counter keeping track of which
> batch of emails have been sent (via session or url parameter) for a quick
> and dirty way to throttle mass emails.
>
> Dawn
>
>
> On Thu, May 21, 2009 at 5:24 PM, Troy Jones <t...@dynapp.com> wrote:
>
>>  Clarke,
>>
>>
>>
>> We have a similar application that sends out mass mailings. In the past we
>> have handled this using cfthread. In this simplified example, the code is
>> using cfthread to set a 1 second interval between each email.
>>
>>
>>
>>                 <cfthread name="#threadName#" action="run">
>>
>>                                 <cfoutput query="getContacts">
>>
>>
>>                                                 <cfset valid_email =
>> IsEmail(email_field)>
>>
>>                                                 <cfif
>> valid_email>
>>
>>
>>
>>
>>                                                                 <!---
>> Build email here --->
>>
>>
>>
>>
>>                                                 </cfif>
>>
>>                                                 <!--- pause one second
>> after sending each email --->
>>
>>                                                 <cfthread action="sleep"
>> duration="1000" />
>>
>>                                 </cfoutput>
>>
>>                 </cfthread>
>>
>>
>>
>> This seems to work pretty well although you may want to adjust the
>> interval (remember, in milliseconds). It has two purposes. First, it takes
>> the processing out of the way of the rest of your other processing.
>> Secondly, and maybe just as important, it will help prevent your mail server
>> from getting tagged as a spam source.
>>
>>
>>
>> Hope this helps.
>>
>>
>>
>> *Troy Jones*
>>
>> Developer/Support Technician
>>
>> Dynapp, Inc
>>
>> http://www.dynapp.com
>>
>>
>>
>> *From:* ad...@acfug.org [mailto:ad...@acfug.org] *On Behalf Of *Clarke
>> Bishop
>> *Sent:* Thursday, May 21, 2009 4:59 PM
>> *To:* discussion@acfug.org
>> *Subject:* [ACFUG Discuss] Sending large numbers of eMail via ColdFusion
>>
>>
>>
>> I’m trying to finish up a cfm/cfc page that will send out about 3,000
>> eMail messages. The messages are press releases and they go to a database of
>> magazine editors, radio/TV stations, etc. Also, the messages have to be
>> individually personalized.
>>
>>
>>
>> John told me: “Don't try to send 3000 all at once. You'll lock up your
>> mail spool.  Do small 50-120 size batches every 10 minutes.”
>>
>>
>>
>> Plus, I got a timeout error when I tried to run the page.
>>
>>
>>
>> So, please point me in the right direction. Right now, I’m thinking:
>>
>> ·         Use cfschedule to call a page every 10 minutes. The page then
>> sends 100 messages.
>>
>> ·         Keep track of which emails have been sent and which page of the
>> query should get sent next.
>>
>> ·         Cancel the cfschedule after all the messages are done.
>>
>>
>>
>> Does anyone have a better suggestion for how to go about this?
>>
>>
>>
>> Thanks,
>>
>>
>>
>>    Clarke
>>
>>
>> -------------------------------------------------------------
>> To unsubscribe from this list, manage your profile @
>> http://www.acfug.org?fa=login.edituserform
>>
>> For more info, see http://www.acfug.org/mailinglists
>> Archive @ http://www.mail-archive.com/discussion%40acfug.org/
>> List hosted by FusionLink <http://www.fusionlink.com>
>> -------------------------------------------------------------
>>
>> No virus found in this incoming message.
>> Checked by AVG - www.avg.com
>> Version: 8.5.339 / Virus Database: 270.12.35/2124 - Release Date: 05/21/09
>> 06:22:00
>>
>> -------------------------------------------------------------
>> To unsubscribe from this list, manage your profile @
>> http://www.acfug.org?fa=login.edituserform
>>
>> For more info, see http://www.acfug.org/mailinglists
>> Archive @ http://www.mail-archive.com/discussion%40acfug.org/
>> List hosted by FusionLink <http://www.fusionlink.com>
>> -------------------------------------------------------------
>>
>
>

Reply via email to