first of all, your cfif syntax is incorrect... Here's what I'd do: <cfparam name="ccEmail" default="" /> <cfif form.inttype eq "K-12"> <cfset ccEmail = "te...@test2.com" /> </cfif> <cfmail from="#FORM.email#" to="t...@test.com" cc="#ccEmail#" Subject="New Jersey"> <!--- EMAIL CONTENTS HERE ---> </cfmail>
This is just cleaner. I didn't actually test this but i don't see any obvious problems with it. -Jake On Mon, Feb 22, 2010 at 8:57 AM, Orlini, Robert <rorl...@hwwilson.com>wrote: > > 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="t...@test.com" > <cfif #form.intype#="K-12">cc="te...@test2.com"</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:331015 Subscription: http://www.houseoffusion.com/groups/cf-talk/subscribe.cfm Unsubscribe: http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=89.70.4