Skip to main content
Participating Frequently
August 25, 2008
Answered

Cfmail dublicate mails

  • August 25, 2008
  • 1 reply
  • 411 views
I am trying to create a form to send an e-mail to me (once the form is filled and submitted). It works, however, I get two e-mails send to my email (myemail@hotmail.com) included in the cfmail. I found out that the problem is that the cfmail code is executed twice, the firs is when the page is loaded, and the second is when the form is filled and submitted. My question is how to make the cfmail executed only when the form is submitted and not when the page is first loaded.
Thanks Text
This topic has been closed for replies.
Correct answer Kronin555
Move the cfmail code block into the :
<cfif isDefined("Submit2")>
that already exists (where you're doing your database insert).

1 reply

Kronin555Correct answer
Participating Frequently
August 25, 2008
Move the cfmail code block into the :
<cfif isDefined("Submit2")>
that already exists (where you're doing your database insert).
fareed100Author
Participating Frequently
August 27, 2008
Fixed!!!!! Thank you very much Kronin555 for your expertise opinion.