> From: Jamie Jackson
>
> In CF5, I've written a wrapper for the <cfmail> tag so that
> it does multipart emails (HTML + Text + attachments, etc.).
> Right now, I construct the final <cfmail> tag as a variable,
> then I write that variable (the cfmail tag) to a file, then
> include it, then delete it. This is inefficient, but it is to
> get around the fact that you can't do things like this:
>
> <!--- can't conditionally include attributes --->
> <cfmail from="#attributes.from#" to="#attributes.to#"
>  <cfif
>   isdefined("attributes.server")>server="#attributes.server#"</cfif>
>  <cfif
>   isdefined("attributes.port")>port="#attributes.port#"</cfif>
>  <cfif
>   isdefined("attributes.query")>query="#attributes.query#"</cfif>
> />
>
> Is there some way around the file write/include/delete
> method? ...Any ideas at all?

I'm not sure about QUERY, but I'm pretty certain that SERVER and PORT
can be left blank

So you could do

<CFPARAM NAME="attributes.server" default="">
<CFPARAM NAME="attributes.port" default="">
<CFMAIL FROM="#attributes.from#" TO="#attributes.to#"
SERVER="#attributes.server#" PORT="#attributes.port#">

You can't put a CF tag within the main part of another CF tag, you can
in the content part of it, but not in the "building" part of it
[Todays Threads] [This Message] [Subscription] [Fast Unsubscribe] [User Settings]

Reply via email to