The code below will work fine for you.  It will throttle down your mail
send rate.  As is it'll send your 11000 emails in 45 mins or so.

This abomination was created when my ISP didn't want me sending more
than about 600 msgs per hr on his shared server.  I still use it to keep
those overzealous spam filters that Jochem mentioned from catching on
(AOL and Hotmail, particularly).  It's very low-tech, but it works.

My ReRun rate is tied to my server's cfmail spool pickup interval (15
secs), and yours should be too.  Note I added an extra second in there
to make sure the spool is flushed.

A solution for grown-ups would be iMS, but I can't figure out a way
around AOL's temporary blocking schemes that will let me shoot out mail
in qty.

--------------------------------------------
 Matt Robertson       [EMAIL PROTECTED] 
 MSB Designs, Inc.  http://mysecretbase.com
  -  -  -  -  -  -  -  -  -  -  -  -  -  -  
 Site Design and ColdFusion Developer Tools
--------------------------------------------

<cfsilent>
<!--- how many messages are sent per operation? --->
<cfset variables.RunRate=10>
<!--- How many seconds between attempts? --->
<cfset variables.ReRunRate=16>
<cfset variables.PerMinute=60/variables.ReRunRate>
<cfset variables.HourRate=variables.RunRate*variables.PerMinute*60>
<cfparam name="url.RunType" type="string" default="NORMAL">
<cfquery 
        name="RecShow" 
        datasource="#request.SiteDSN#" 
        cachedwithin="#CreateTimeSpan(0,0,1,0)#">
        SELECT 
                cm_topics.ID,
                cm_topics.PageText,
                cm_topics.Title
        FROM cm_topics
        WHERE 
                cm_topics.ID=#client.EditMarker#
</cfquery>
<cfquery 
        datasource="#request.SiteDSN#" 
        name="GetSelf" 
        cachedwithin="#CreateTimeSpan(0,0,1,0)#">
        SELECT 
                cm_users.Email
        FROM cm_users
        WHERE 
                cm_users.ProCode=#client.Producer#
</cfquery>
<cfquery 
        datasource="#request.SiteDSN#" 
        name="MailRun" 
        cachedwithin="#CreateTimeSpan(0,0,1,0)#">
        SELECT 
                cm_email.EmailAddr
        FROM cm_email
        WHERE 
                cm_email.EmailAddr IS not NULL
        AND
                cm_email.ParentID=#client.EditMarker#
        ORDER BY
                cm_email.ID ASC
</cfquery>
<cfparam name="url.ThisStart" default=1 type="numeric">
</cfsilent>
<cfheader name="Expires" value="Sun, 06 Nov 1994 08:49:37 GMT">
<cfheader name="Pragma" value="no-cache">
<cfheader name="cache-control" value="no-cache, no-store,
must-revalidate">
<cfif ThisStart GT MailRun.RecordCount>
        <html><head><title>FINISHED</title></head><body
bgcolor="#FFFFFF" ONLOAD=history.go(1)>
        <H1><font color="#008000">All Done</font></H1>
        <b><font color="#800000">You should close this browser
window</font>!</b>
        <p><b>Do not press your BACK button</b> to leave, or you could
wind up sending some email messages all over again.
        </body></html>
<cfelse>
        <cfoutput query="MailRun">
                <cfset form.MessageBody=RecShow.PageText>
        </cfoutput>
        <cfset variables.NextStart=url.ThisStart+20>
        <cfset variables.NextDisplay=url.ThisStart+19>
        <cfif variables.NextDisplay GT MailRun.RecordCount>
                <cfset variables.NextDisplay=MailRun.RecordCount>
        </cfif>
        <!--- set a UUID in the url to help make sure the browser keeps
the page out of the cache. --->
        <cfset variables.UURL=UrlEncodedFormat(CreateUUID())>
        <html>
        <cfoutput>
        <meta 
                http-equiv="REFRESH" 
                content="#variables.ReRunRate#;
        
URL=#CGI.SCRIPT_NAME#?ThisStart=#variables.NextStart#&UURL=#variables.UU
RL#">
        </cfoutput>
        <head><title>Low Volume Mass Mailer</title></head><body
bgcolor="#FFFFFF" ONLOAD=history.go(1)>
        <font FACE="Georgia, Times New Roman, Times">
        <!--- 
        this is version 1, tested over time to work fine at large
volumes 
        --->
        <cfset variables.ContentValue="text/html; charset=" & chr(34) &
"iso-8859-1"&Chr(34)>
        <cfmail 
                to="#MailRun.EmailAddr#"
                from="#GetSelf.Email#"
            subject="#RecShow.Title#" 
                server="#Settings.EmailServer#"
                query="MailRun" 
        maxrows="#variables.RunRate#"
            startrow="#url.ThisStart#"
                type="HTML">
#RecShow.PageText#
        <cfmailparam name="Reply-To" value="#GetSelf.Email#">
        <cfmailparam name="Message-ID"
value="<#CreateUUID()#@#Settings.EmailServer#>">
        <cfmailparam name="Content-Type"
value="#variables.ContentValue#">
        <cfmailparam name="Mime-Version" value="1.0">
        </cfmail>
        <cfset
variables.NumLeft=MailRun.RecordCount-(variables.NextDisplay-1)>
        <cfset
variables.TimeLeft=fix(variables.NumLeft/variables.PerMinute)>
        <cfoutput>
        <H1><font color="##800000">Sending messages</font>
#url.ThisStart# <font color="##800000">thru</font>
#variables.NextDisplay#</H1>
        <table border="1" cellpadding="4" cellspacing="0"
bgcolor="##ffffcc"> 
        <tr>
                <td align="right"><SPAN class="FormBody">Total to
send:</SPAN></td>
                <td><SPAN
class="Smaller">#MailRun.RecordCount#</SPAN></td>
        </tr>
        <tr>
                <td align="right"><SPAN class="FormBody">Total
Remaining:</SPAN></td>
                <td><SPAN
class="Smaller">#variables.NumLeft#</SPAN></td>
        </tr>
        <tr>
                <td align="right"><SPAN class="FormBody">Estimated
Completion:</SPAN></td>
                <td><SPAN class="Smaller">
                <cfif variables.TimeLeft GT 0>
                About <font color="##008000">#variables.TimeLeft#</font>
minute<cfif variables.TimeLeft GT 1>s</cfif>
                <cfelse>
                Less than one minute.
                </cfif>
                </SPAN></td>
        </tr>
        </table>
        <p>This page will send email in batches of #variables.RunRate#
messages at #variables.ReRunRate#-second intervals, for an hourly
throughput rate of #variables.HourRate# messages per hour.</p>
        </cfoutput>
        <p>You should leave your computer completely untouched and wait
for this job to complete.  When it finishes, you will be notified.
        </font>
        </body></html>
</cfif>

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Archives: http://www.houseoffusion.com/cf_lists/index.cfm?forumid=4
Subscription: 
http://www.houseoffusion.com/cf_lists/index.cfm?method=subscribe&forumid=4
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Signup for the Fusion Authority news alert and keep up with the latest news in 
ColdFusion and related topics. http://www.fusionauthority.com/signup.cfm

                                Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4
                                

Reply via email to