Actually,

I'm not calling the e-mail code using a custom tag. It's the action
page. I'm submitting the logTran field, test if it's equal to yes and
run the CFMAIL tag.

Thanks again for any help.

-----Original Message-----
From: Dave Watts [mailto:[EMAIL PROTECTED]] 
Sent: Wednesday, September 26, 2001 12:43 PM
To: CF-Talk
Subject: RE: Help with CFMail

> I'm using the following piece of code to send a notification e-mail:
>
> <cfif logTran = "yes">
>       <cfmail subject="Thank you" to="#attributes.clientemail#"
> from="#application.companyemail#">
>               xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>               xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx
>       </cfmail>
> </cfif>
>
> For some reason, the e-mail notification is sent twice. I don't know
> how. Did anybody have a similar issue?

In the calling page, are you closing the custom tag?

<cf_sendthismail clientemail="[EMAIL PROTECTED]">
</cf_sendthismail>

If so, you're executing the custom tag twice. When you close a custom
tag,
it'll execute once for the opening tag, and once for the closing tag.
Within
the custom tag, you can check the variable ThisTag.ExecutionMode - if
it's
"start", you're executing the opening tag, and if it's "end", you're
executing the closing tag. So, you can simply add some conditional logic
to
your custom tag to only send the mail once.

Dave Watts, CTO, Fig Leaf Software
http://www.figleaf.com/
voice: (202) 797-5496

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Get the mailserver that powers this list at http://www.coolfusion.com
FAQ: http://www.thenetprofits.co.uk/coldfusion/faq
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists

Reply via email to