Oops, I spoke too soon. That's what I get for NOT reading all the code. You can do this if you want to do it INLINE:
<CFMAIL from="#FORM.email#" To="[email protected]" cc="#iif(form.intype EQ 'K-12',DE('[email protected]'),DE(''))#" Subject="New Jersey"> Dave Phillips -----Original Message----- From: Dave Phillips [mailto:[email protected]] Sent: Monday, February 22, 2010 9:23 AM To: '[email protected]' Subject: RE: CFIF within CFmail? Actually, that's not true. You can easily put CFIF inside of your cfmail tag. I've done it for 12+ years! Your only problem was that you used the equals sign (=) instead of EQ. This should work for you: <CFMAIL from="#FORM.email#" To="[email protected]" <cfif form.intype EQ "K-12">cc="[email protected]"</Cfif> Subject="New Jersey"> -----Original Message----- From: I. Addoum. [mailto:[email protected]] Sent: Monday, February 22, 2010 9:03 AM To: cf-talk Subject: Re: CFIF within CFmail? that will not work ... you should have your CFIF before the cfmail tag <cfif form.intype EQ "K-12"><CFSET V_cc="[email protected]"> <CFELSE> <CFSET V_cc=""> </Cfif> <CFMAIL from="#FORM.email#" To="[email protected]" cc="#V_cc#"Subject="New Jersey"> ________________________________ From: "Orlini, Robert" <[email protected]> To: cf-talk <[email protected]> Sent: Mon, February 22, 2010 4:57:08 PM Subject: CFIF within CFmail? Hello, I'm trying to include a cfif within a cfmail. If a form element is "K-12", then I want to add a cc to the cfmail part. Here is what I have in part: <CFMAIL from="#FORM.email#" To="[email protected]" <cfif #form.intype#="K-12">cc="[email protected]"</Cfif> Subject="New Jersey"> It generates an error. Is there a better way to do this? Thanks. RO HWW ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~| Want to reach the ColdFusion community with something they want? Let them know on the House of Fusion mailing lists Archive: http://www.houseoffusion.com/groups/cf-talk/message.cfm/messageid:331021 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4

