Max wrote:
>Any chance your SQL code that selects the recipients is getting
2 records per recipient? Just because
> your DB contains something doesn't mean enough to presume
anything, I'd say. I've never seen this
> issue with any version of iMS (though I'm not using the 2.1
betas so can't comment on those).
no, max, the application has been working fine until today (no
code changed, no changes to the database structure)... suddenly it's
started sending two copies. my code is below. basically, approximately
20,000 subscribers are held in the database. whenever an email is
scheduled, it adds the recipients to the 'actualdeliveries' table with
'emailsent' set to 0. the scheduler code below runs via the coldfusion
scheduler every 10 minutes or so, and sends 500 emails at a time,
updating the recipients 'emailsent' field to 1 so as to prevent them
receiving duplicates. the problem's not with that field being sent, as
the duplicates are being sent at the same time, not on subsequent
runs...
any help? i have to get this fixed by 9am monday (uk time = 1am
usa time)
ps. version = infusion post server se version 22
<!--- EMAIL DELIVERY SCHEDULER --->
<!--- Queries the actualdeliveries database table and sends up
to 500 messages at a time.--->
<cfquery name="getactualdeliveries"
datasource="#application.datasource#" dbtype="#application.dbtype#"
username="#application.username#" password="#application.password#"
dbserver="#application.dbserver#" dbname="#application.dbname#"
maxrows="500">
SELECT
emailrecipientaddress,emailforename,emailsurname,emailuserid,emailconten
tid,emailsendid
FROM actualdeliveries
WHERE emailsent = 0
ORDER BY emailuploadeddate ASC
</cfquery>
<cfoutput query="getactualdeliveries">
<!--- get the email content --->
<cfquery name="getactualemail"
datasource="#application.datasource#" dbtype="#application.dbtype#"
username="#application.username#" password="#application.password#"
dbserver="#application.dbserver#" dbname="#application.dbname#" >
SELECT actualemailcontent,actualemailsubject
FROM actualemails
WHERE actualemailid=#emailcontentid#
</cfquery>
<cfx_imsmail smtpto="#trim(emailrecipientaddress)#"
failto="#trim(application.failtoaddress)#"
from="#trim(application.fromaddress)#"
header_to="#trim(emailrecipientaddress)#"
header_subject="#trim(getactualemail.actualemailsubject)#"
header_from="#trim(application.fromaddress)#"
subject="#trim(getactualemail.actualemailsubject)#" log="yes"
body="Dear #trim(emailforename)# #trim(emailsurname)#
#getactualemail.actualemailcontent#"
>
<!--- now - very important - set the email as sent --->
<cfquery name="setassent"
datasource="#application.datasource#" dbtype="#application.dbtype#"
username="#application.username#" password="#application.password#"
dbserver="#application.dbserver#" dbname="#application.dbname#"
maxrows="500">
UPDATE actualdeliveries
SET
emailsent=1,emailsentdate='#dateformat(now(),"mm/dd/yyyy")#
#timeformat(now(), "HH:MM:SS")#'
WHERE emailsendid=#emailsendid#
</cfquery>
</cfoutput>
<cfif not getactualdeliveries.recordcount is 0>
<!--- send a summary to me or to agalinks --->
<cfset ad="">
<cfloop query="getactualdeliveries">
<cfset ad=listappend(ad,getactualdeliveries.emailsendid)>
</cfloop>
<cfx_imsmail smtpto="#application.failtoaddress#"
failto="#application.failtoaddress#" from="#application.fromaddress#"
header_to="#application.failtoaddress#"
header_subject="Newsletter sent"
header_from="#application.fromaddress#"
subject="Newsletter sent" log="yes"
body="This following deliveries have been made:
#ad#
">
</cfif>
</body>
</html>
N��+-���z��>���[�#N��+,��*x�z��j)Rz�ޮ���z�b�X���^jǜ�jez���f���i��0��(�����ܢo�1$���+���5�jx�H7�zZ)z�bq��y(���_����祉ǧ��^��m����
��_�Ȩ��&�#
�ޖ�^�������܆+m����
��V�r�y�&�)ߺȨ�隊^4z�j���o͢ט��z˛���m�Z��܆+ލ��
winmail.dat