• Global community
    • Language:
      • Deutsch
      • English
      • Español
      • Français
      • Português
  • 日本語コミュニティ
    Dedicated community for Japanese speakers
  • 한국 커뮤니티
    Dedicated community for Korean speakers
Exit
0

CFMAIL sending duplicate messages

Guest
Dec 06, 2007 Dec 06, 2007

Copy link to clipboard

Copied

I'm banging my head against the wall here. I've got a very simple query that I'm looping through to send messages using CFMAIL. Every record in the query gets sent two copies of the message. For example, right now I am using a test list that contains 9 email addresses.

I've tried everything...adding/removing mailparts, GROUPing by email, looping and cfoutputing, etc. Dumping the query shows 9 results. The counter shows 9 iterations. 18 email messages get sent. Why, oh why???

EDIT: I'm running CF 7.02 in Win2003 server

Views

2.2K

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 07, 2007 Dec 07, 2007

Copy link to clipboard

Copied

No one has any ideas?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Dec 07, 2007 Dec 07, 2007

Copy link to clipboard

Copied

If you are absolutely sure that the getAllUsers resultset returns only 9 records then I suspect something is causing the page/CFC to be called twice.

If you post your entire page, including CFCs being used, and your query including the underlying table structure we might have more to go on.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 07, 2007 Dec 07, 2007

Copy link to clipboard

Copied

Thanks for the reply Bob.

Here is the query (CFDUMPed & obfuscated)

1 xxx@syr.edu Yes Rxxx Vxxxnti 1111
2 xxx@syr.edu Yes Rxxx Vxxxnti 3333
3 xxx@syr.edu Yes Rxxx Vxxxnti 4444
4 xxx@syr.edu Yes Rxxx Vxxxnti 5555
5 xxx@syr.edu Yes Rxxx Vxxxnti 6666
6 xxx@syr.edu Yes Rxxx Vxxxnti 7777
7 xxx@syr.edu Yes Rxxx Vxxxnti 8888
8 xxx@syr.edu Yes Rxxx Vxxxnti 9999
9 xxx@syr.edu Yes Rxxx Vxxxnti 2222


and that IS all of the code! No cfcs, etc. I've tweaked it a bit since, gotten rid of the cfoutput loop - I'm just calling cfmail using the query. Still experiencing the same issue. Every message gets sent twice. The mail log in CF admin shows 18 messages each time I run the script.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Dec 07, 2007 Dec 07, 2007

Copy link to clipboard

Copied

Try removing the group attribute from the cfmail tag.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 07, 2007 Dec 07, 2007

Copy link to clipboard

Copied

It's already gone - I added that in an effort to fix the issue, it made no difference.

Here is another thing - this is happening on two fully patched servers. I was running on my test server, I just moved it to production and I get the same results. Grrrr.

Here is the code as it is now:

<cfquery name="getAll" datasource="xxxxxxxxxx" >
SELECT *
FROM [syr users$]
</cfquery>

<cfdump var="#getAll#">



<cfmail from="xxxxxxxxxxxxx"
server="xxxxxxxxxxxxx"
username="xxxxxxxxxxxxx"
password="xxxxxxxxxxxxx"
to="#email#"
subject=" Login Credentials"
type="html"
debug="Yes"
query="getAll"
>


<p>
Below please find a link for the login page on the xxxxxxxxxxxxx web site. Included in this email is your user ID (which is the same as your email address) and your temporary password. After you have logged infor the first time, you will be asked to create a new password. Please use the same parameters for creating this password as you would for your NetID.
</p>
<p>
<a href="xxxxxxxxxxxxx">xxxxxxxxxxxxx</a> <br />
Username: #getall.userid# <br />
Temporary Password: #getall.pw#
</p>
<p>
If you have any trouble logging in, please contact me <br />

</p>

</cfmail>

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Advisor ,
Dec 07, 2007 Dec 07, 2007

Copy link to clipboard

Copied

Are you nesting your cfmail inside a cfoutput query="" or cfloop tag? If so you don't need the query attribute in the cfmail tag. I suspect that would cause the query to be looped through twice.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 07, 2007 Dec 07, 2007

Copy link to clipboard

Copied

What requests this script to be run? How is the mailing triggered? I
would put some code that would log when and how the template is called
to see if it is being called twice somehow.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 07, 2007 Dec 07, 2007

Copy link to clipboard

Copied

Nope - that is the entirety of the code.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 07, 2007 Dec 07, 2007

Copy link to clipboard

Copied

Ian - I'm calling it manually, by refreshing it in my browser.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 07, 2007 Dec 07, 2007

Copy link to clipboard

Copied

SYRRoss wrote:
> Ian - I'm calling it manually, by refreshing it in my browser.

Next I would put detailed, to the milli-second, time stamp data in each
e-mail. This should say whether two exact copies are being sent or that
the query is somehow being run twice generating two e-mails.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 07, 2007 Dec 07, 2007

Copy link to clipboard

Copied

Great tip Ian - this did show me that the page is being called twice when I refresh. I have no idea why, but at least I know what is happening!

Thanks everyone for your help.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 07, 2007 Dec 07, 2007

Copy link to clipboard

Copied

SYRRoss wrote:
> Great tip Ian - this did show me that the page is being called twice when I refresh. I have no idea why, but at least I know what is happening!
>
> Thanks everyone for your help.

Take a look in your directory and all parent directories for any
Application.cfm, Application.cfc or OnRequestEnd.cfm templates. If one
of these existed and it also runs the code you are working on, then two
copies of the e-mail would be created and sent.

This is the only thing I can think of that would cause duplication like
you have described.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Guest
Dec 07, 2007 Dec 07, 2007

Copy link to clipboard

Copied

I do have application.cfc, but I don't understand why it would execute the template twice. Doesn't CF first parse application.cfc, then the template, then onReqestend?

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
LEGEND ,
Dec 07, 2007 Dec 07, 2007

Copy link to clipboard

Copied

SYRRoss wrote:
> I do have application.cfc, but I don't understand why it would execute the template twice. Doesn't CF first parse application.cfc, then the template, then onReqestend?

It wouldn't execute the template twice, but it is possible that the
application.cfc file is ALSO executing the e-mail code or a form of it.
Possible with a <cfinclude...> or some other code.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
New Here ,
Dec 10, 2007 Dec 10, 2007

Copy link to clipboard

Copied

I've just started experiencing something very similar here after upgrading to CF8, although I'm not sure the upgrade has caused an issue.

Anyway, the interesting thing is that if my client runs the page, the emails are sent twice, if I do they are sent only once. It's not a code issue.

I was wondering if there was some kind of pre-fetching going on with a proxy server, or Google web accelerator, that would explain why I don't see the issue but the client does. And no, they are not clicking the submit btn twice! However, they insist that they don't use a proxy server or Google Web Acc, so I'm back to being stumped totally here.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Explorer ,
Feb 08, 2008 Feb 08, 2008

Copy link to clipboard

Copied

LATEST
I am experiencing the duplicate cfmail problem as well. WE ARE DUE FOR ANOTHER PATCH!!!!

I am running an extensive opt-in email application on a server with the chf8000002.jar patch and it's not sending duplicates.

But here's the gotcha - if I want my PDF's to generate correctly (without the resizing issue) I have to run the chf8000001.jar patch. I have sent a request to Adobe to release a new patch for these problems.

Been a CF guy for along time and these issues make me hate mergers. Hopefully this can be corrected, word-up B. Forta.

Votes

Translate

Translate

Report

Report
Community guidelines
Be kind and respectful, give credit to the original source of content, and search for duplicates before posting. Learn more
community guidelines
Resources
Documentation