> I need to CFMAIL to about 2000 email addresses. Anyone have a good bit
> of  code  implementing  a  loop  with  my query so this thing does not
> timeout? Any other problems I might run into??

OK, here's a (very) brief description of how I do it (written in
pseudo-code)

Put an additional field into the table

<meta refresh 300 seconds>
<cfquery>
Select top 100 ID, Email, NewField
from emailTable
where newField is NULL
</cfquery>
<cfloop query="emailQuery">
        <cfmail>
        </cfmail>
        <cfquery>
                update emailTable
                set newField='Sent'
                where ID=#ID#
        </cfquery>
</cfloop>

This way you only send a small amount every 5 minutes, it should clear those
before the next batch hits

You can play with the numbers to find how quickly your emails go to the mail
server and when to refresh

Philip Arnold
Director
Certified ColdFusion Developer
ASP Multimedia Limited
T: +44 (0)20 8680 1133

"Websites for the real world"

**********************************************************************
This email and any files transmitted with it are confidential and
intended solely for the use of the individual or entity to whom they
are addressed. If you have received this email in error please notify
the system manager.
**********************************************************************



~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at 
http://www.fusionauthority.com/bkinfo.cfm

Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to