You can also use a cfparam as well:
<cfparam name="session.Form.CCEmail" default="">
<cfmail to="[EMAIL PROTECTED]"
from="[EMAIL PROTECTED]"
subject="Order Information"
cc="#session.Form.CCEmail#"
type="HTML">
----- Original Message -----
From: "Stevens, Jason" <[EMAIL PROTECTED]>
To: "CF-Talk" <[EMAIL PROTECTED]>
Sent: Thursday, May 17, 2001 2:41 AM
Subject: Imbedding IF statements into a tag.......
> Is it possible to imbed IF statements into a tag? For example, you have
the
> following statement:
>
> <cfmail to="[EMAIL PROTECTED]"
> from="[EMAIL PROTECTED]"
> subject="Order Information"
> cc="#session.Form.CCEmail#"
> type="HTML">
>
> Of course, when the session variable session.Form.CCEmail doesn't exist,
it
> error's off. Would there be a way to imbed an if statement that would only
> add the cc section of the cfmail tag if the variable exists without
writing
> is as:
> <cfif isdefined("session.Form.CCEmail")>
> cfmail with cc section
> <else>
> cfmail without the cc section
> </cfif>
> I would rather do it inline of the tag if possible. Even if it just leave
> the variable at a zero value, so long as the variable is set and it won't
> error off.
>
> Thanks in advance, (sorry for the newbie question :)
>
>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Structure your ColdFusion code with Fusebox. Get the official book at
http://www.fusionauthority.com/bkinfo.cfm
Archives: http://www.mail-archive.com/[email protected]/
Unsubscribe: http://www.houseoffusion.com/index.cfm?sidebar=lists