<cfsilent>
    <!---
        Run Rate is the number of seconds between refresh.  To
        optimize this make this setting about 2 seconds longer
        than the ColdFusion Server's mail spool fetch rate.  
        Otherwise mail will pile up in the spooler and partially
        defeat the purpose of trickling out the mail
     --->
    <cfset variables.RunRate=17>
    <!---
        Query Run is the number of query rows (email addresses)
        that will be processed on each execution of this template
    --->
    <cfset variables.QueryRun=20>
    <!---
        pull the email addresses.  Cache this query since its
        going to be re-used every few seconds.
    --->
    <cfquery datasource="#request.myDSN#" name="MailList"
cachedwithin="#CreateTimeSpan(0,1,0,0)#">
       SELECT mylist.myEmail
       FROM mylist
       WHERE mylist.myEmail IS NOT NULL
       ORDER BY mylist.myPrimaryKey ASC
    </cfquery>
    <!---
        Set the starting point of the mail run to the first
        record of query output
    --->
    <cfparam name="url.CurrStart" default="1" type="numeric">
    <!---
        Do some stuff to prevent page caching, which was found to
        be a problem on some client browsers
    --->
    <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">
</cfsilent>
<!---
    Are we there yet?
--->
<cfif url.CurrStart GT MailList.RecordCount>
   <!---
       yes.  Inform the user
   --->
   <html>
        <head>
            <title>FINISHED</title>
        </head>

       <body >            <h1>All Done</h1>
           <b>Close this browser window!</b>
           <p><b>Do NOT press your BACK button</b> to leave.</p>
       </body>
    </html>
<cfelse>
   <!---
       No.  Calculate the *next* starting point, and some other
       values used in the display below
   --->
   <cfset variables.NextRun=url.CurrStart+variables.RunRate>
   <cfset variables.NextShow=url.CurrStart+(variables.RunRate-1)>
   <cfif variables.NextShow GT MailRun.RecordCount>
      <cfset variables.NextShow=MailRun.RecordCount>
   </cfif>
   <!---
       display the "in-progress" page
   --->
   <html>
   <cfoutput>
   <!---
       This next line re-runs the template automatically at the run
rate,
       with the incremented starting value.  Note the UUID inserted into

       the url.  This is another part of ensuring the browser doesn't
       cache this page.
   --->
   <meta http-equiv="REFRESH" content="#variables.RunRate#;
         URL="">          &UniqueURL=#UrlEncodedFormat(CreateUUID()#">
   </cfoutput>
   <head>
        <title>Low Volume Mass Mailer</title>
   </head>
   <body >    <!---  
       Send the actual mail.  This is a very simple version, with
       hardcoded values in many places where, in a real application,
       you'd be plugging in default values or output from other
       queries (such as the mail server name, the sender address and
       the email message text.
   --->
   <cfset variables.CharSet="text/html;
charset="&chr(34)&"utf-8"&Chr(34)>
   <cfmail
      to="#MailList.myEmail#"
      from="[EMAIL PROTECTED]"
      subject="SnailMail"
      server="mail.blah.com"
      query="MailRun"
      maxrows="#variables.QueryRun#"
      startrow="#url.CurrStart#"
      type="HTML">
    <h1>YOUR EMAIL TEXT GOES HERE</h1>
    <cfmailparam
       name="Reply-To"
       value="[EMAIL PROTECTED]">
    <cfmailparam
       name="Message-ID"
       value="<#CreateUUID()[EMAIL PROTECTED]>">
    <cfmailparam
       name="Content-Type"
       value="#variables.CharSet#">
    <cfmailparam
       name="Mime-Version"
       value="1.0">
   </cfmail>
   <!---
   give the user a visual cue as to where the operation is at the moment

   --->
   <cfoutput>
       <p>Sending messages #url.CurrStart# thru #variables.NextShow#<br>
       <b>Total to send: #MailRun.RecordCount#</b></p>
   </cfoutput>
   <!---
       This is a good place to do some extra calculations so you can
show
       the user how many messages have been processed, how many are left

       and an extimated time to completion
    --->
   <p>Leave this system alone and wait for this job to complete.</p>
   <p>When it finishes, you will be notified.</p>
   </body></html>
</cfif>

-----Original Message-----
From: Tom Jordahl [mailto:[EMAIL PROTECTED]
Sent: Friday, June 11, 2004 2:46 PM
To: CF-Talk
Subject: RE: Slow Down CFmail?


Mark,

CFMX Professional has limits on the number of messages it will
deliver when
the spooler runs.  The formula in CFMX 6.1 is:

        int batch_size = 35;

        if (size > 100)

        {

            batch_size = size / (int)Math.log ((double)size);

            if (batch_size > 1000) batch_size = 1000;

            if (batch_size < 35) batch_size = 35;

        }

There are no external tweaks to this calculation.

CFMX Enterprise goes flat out till *all* of the messages are
delivered, and
then it will go to sleep for the spool interval.

--
Tom Jordahl
Macromedia Server Development

-----Original Message-----
From: Mark W. Breneman [mailto:[EMAIL PROTECTED]
Sent: Thursday, June 10, 2004 2:56 PM
To: CF-Talk
Subject: RE: Slow Down CFmail?

The mail server is GMS (Gordano Messaging Server)
http://www.ntmail.co.uk/
We contacted the makers and they told us that the "pro version"
(250 user)
we have will slow down sending mail after a Approx, 5000
messages per day
have been reached. (I do not remember the exact number of
messages) If we
upgraded to the enterprise version we would not see the
slowdown. Even
though it would be just a SN that we would plug-in to our
existing server to
make the server the enterprise version. : - (

The solution found at http://tutorial256.easycfm.com/ would work
very well,
(in fact I am using something like that for another client.)
But, I have
several clients mail list that I can't spend the time on
rebuilding. I wish
I could.

I think tweaking something like the spooler frequency in the
CFADMIN is what
I am looking for.

Does anyone know how many messages the spooler will take each
time it checks
for new messages? Can that be tweaked in one of the xml config
files?

Mark W. Breneman
-Cold Fusion Developer
-Network Administrator
  Vivid Media
  [EMAIL PROTECTED]
  www.vividmedia.com
  608.270.9770

  _____
________________________________
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to