Uh oh, I've really goofed here, but I'm not sure where I went wrong. I
sent out a newsletter to several thousand subscribers last night, but
instead of everyone getting one copy, they got dozens. To one address, I
got 30copies, and to another I got 65!! There must be a logic error but
I can't see where ..
Since there are thousands on the list, if CF was looping though the entire
list at each point, then surely I'd have got thousands of copies. I
stopped the server when the first phone call came in, and the database
shows that down to number 292 got the message. However my own email
address is at number 2953. So the whole list must have got several
copies.
Can anyone see the fault? Please?
Here's the shortened version of the action template:
<!---- Gets the list to send to -------->
<!---- messagesent is a flag to show the address has already received a
message ---->
<cfquery name="maillist" datasource="whatever">
SELECT *
FROM dbo.majordomo
where messagesent = '0'
Order by memberid
</cfquery>
<!---- Sending the message -------->
<cfloop query="maillist" startrow="1">
<!---- Transaction to make sure if the message isnt sent the flag isnt set
----->
<cftransaction>
<!---- Update the mailing list message sent flag and time ------>
<cfquery NAME="setyes" DATASOURCE="whatever">
update majordomo set
messagesent='1',
messagesentwhen=#createodbcdatetime(Now())#
where memberid='#maillist.memberid#'
</cfquery>
<!---- send the message --------->
<cfmail query="maillist" to="#emailaddy#" from="#form.from#"
subject="#form.subject#" timeout=60>
#form.messagetogo#
#form.Disclaimer#
</cfmail>
<!------- add a loop to force the mail server to pause slightly to allow
the shop to get a word in edgeways if it wants to process a transaction
---------->
<cfloop index="x" from="1" to="10000"></cfloop>
</cftransaction>
</cfloop>
I'm in deep doodoo over this and I can't see what's wrong with my
template.
Cheers,
Mike Kear
AFP Web Development
Windsor, NSW, Australia
------------------------------------------------------------------------------
Archives: http://www.eGroups.com/list/cf-talk
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.