Skip to main content
Inspiring
November 3, 2010
Question

CFMAIL is sending duplicate messages

  • November 3, 2010
  • 3 replies
  • 4856 views

We are experiencing a problem with our server at the moment where cfmail is sending out two copies of every email.  I'm guessing its a bug in ColdFusion but I wondered if anyone had experience dealing with this.

It has happened twice now and each time it has been solved by restarting the ColdFusion Application service.

- we run ColdFusion 9.0.1

- we send out roughly 100k of emails every day

- this problem has surfaced twice now since rolling out 9.0.1, with roughly 2-3 weeks in between occurences

    This topic has been closed for replies.

    3 replies

    BKBK
    Community Expert
    Community Expert
    November 6, 2010

    Is cfmail in a custom tag by any chance?

    Inspiring
    November 8, 2010

    You're thinking perhaps about how custom tags will run twice if they're only on one line but have a closing slash like XHTML coding?  Yes, I thought of that as well, but that is not the case.  And most of the code is run out of a component, not a custom tag.

    And it is not double-clicking.  I've submitted the form to test it myself and it came through as two messages.

    Let me reiterate:

    1. I submit a form that sends an email.  I get two copies.

    2. I restart the ColdFusion service.

    3. I submit the same form again.  I get one copy of the email.

    There's no way that I know of in which that can be a coding error or user error.  I think I'm going to submit a bug report about it at this point.  I just wanted to see if anyone else had experienced something similar.

    Inspiring
    November 8, 2010

    There is another thread going on here with exactly the opposite problem on CF9 - not all messages are being sent.  What I would do in your case to begin the debugging is to put somewhere (maybe at the bottom so that it doesn't look that visible to your yours) a unique number.  CF gives you a variety to choose from.  The goal is to determine whether you are somehone calling CFMAIL twice, or whether CFMAIL is processing your call twice.  This should help to sort that out, depending on whether the received messages have the same unique value in them.  Once we know a little more about which scenario you are dealing with, we might be able to come up with further debugging ideas.

    -reed

    Inspiring
    November 6, 2010

    We're running CF8 but we had an issue for the longest time where we were getting 2 or more messages (on some messages).

    After months of troubleshooting, we found out it was simply users thinking that web forms need to be double clicked.

    We've since implemented javascript functionality that disables the button after the first click.

    I tell ya... some people.... *chuckles*.... double clicking form buttons.....  ugh.

    Dileep_NR
    Inspiring
    November 4, 2010

    Are you using 'cfmail - query' for sending mails? if yes please use the 'group' attribute in cfmail

    Also please give your code set.

    Inspiring
    November 5, 2010

    No, we do not use the query attribute in cfmail at all, and I'm aware of

    how that can commonly cause my problem.

    This is not a coding issue, at least not in any way that I can conceive of.  The code is really irrelevant.

    After a couple weeks, we start getting duplicate emails.  We restart the service and that problem goes away.  That's a ColdFusion bug, to my mind.  Or perhaps some very weird configuration problem.