Ask a Question related to Macromedia ColdFusion, Design and Development.
-
neilorourker #1
Cfif in CFMAIL
I am using the following to send an email based on information received through
a form.:
<cfoutput query="mailattachement"><cfset emailimage =
'#submissions##sample1#'></cfoutput>
<cfmail to="x@galleries-online.co.uk; [email]x@yahoo.co.uk[/email]"
from="x@galleries-online.co.uk" <cfif (form.sample1) GT
0>mimeattach="#emailimage#"</cfif> subject="Artist expression of interest"
type="html">Hello all<br><br>The following artist has expressed an interest in
joining Galleries-online<br><br><strong>Name:</strong> #form.name#<cfif
(form.url) GT 0><br>
<strong>Web address:</strong> <a href="#form.url#">#form.URL#</a>
</cfif><br><br><strong>Comments from
artist:</strong><br>#form.comments#<br><br>
I'd really appreciate it if you could take a look at their work and let me
know
what you think. In order to do this, login in to the admin area at: <a
href="http://www.galleries-online.co.uk/smslogin.cfm">[url]http://www.galleries-onlin[/url]
e.co.uk/smslogin.cfm</a>
and click on expressions of interest.<br>
<br>Cheers<br><br>Neil</cfmail>
Everything works fine until I try to place the 'mimeattach' part of the tag
into a CFIF statement which results in the following:
Just in time compilation error
Invalid token found on line 59 at position 103. ColdFusion was looking at the
following text:
<
The mimeattach attribute works fine otherwise.
Cheers for any suggestions
Neil
neilorourker Guest
-
CFMAIL - CFIF
Anyone have ideas how i could set up a survey form that emails to different email addresses depending on what the content of the survey is? I'm... -
Newbie help - CFIF and CFMAIL
I can't figure out why this is not working. I have a form and once the elements of the form is completed, the info is email to me. Basically the... -
<cfmail></cfmail> in a script
I am wondering if I can put <cfmail> tags and code within a javascript script. will the browser recognize it, and perform the instructions? ... -
cfmail - Attribute validation error for tag CFMAIL.
I'm getting the error ' Attribute validation error for tag CFMAIL.' on the code below. All its doing is outputting a text string to the TO: field. ... -
cfif being ignored
I wanted this to only execute if FORM.rp_image does not = defaultImg.gif but it seems to always run. I thought the syntax was okay but maybe not. ... -
Laksma #2
Re: Cfif in CFMAIL
The error was generated because you put a tag inside a tag. In order to fix it,
use iif () (immediate if) function.
Laksma Tirtohadi
<cfmail to="x@galleries-online.co.uk; [email]x@yahoo.co.uk[/email]"
from="x@galleries-online.co.uk" #iif(form.sample1 GT 0,
DE("mimeattach=#emailimage#"), DE(""))# subject="Artist expression of interest"
type="html">
Laksma Guest
-
neilorourker #3
Re: Cfif in CFMAIL
thanks for your quick response.
I tried pasting you code into the template but recieved the following error:
Just in time compilation error
Invalid token found on line 58 at position 103. ColdFusion was looking at the
following text:
#
Neil
neilorourker Guest
-
Laksma #4
Re: Cfif in CFMAIL
It seems ColdFusion doesn't allow a CF function inside a CF tag. I usually use
the technique in HTML tag.
Anyway, instead of wasting the development time, use the following technique.
Remember, this is NOT a good technique, but at least it works.
<cfoutput query="mailattachement">
<cfset emailimage = '#submissions##sample1#'>
</cfoutput>
<cfif form.sample1 GT 0>
<cfmail to="x@galleries-online.co.uk; [email]x@yahoo.co.uk[/email]"
from="x@galleries-online.co.uk" mimeattach="#emailimage#" subject="Artist
expression of interest" type="html">
Your email message.
</cfmail>
<cfelse>
<cfmail to="x@galleries-online.co.uk; [email]x@yahoo.co.uk[/email]"
from="x@galleries-online.co.uk" subject="Artist expression of interest"
type="html">
Your email message.
</cfmail>
</cfif>
Laksma Guest
-
Fernis #5
Re: Cfif in CFMAIL
Also, CFSAVECONTENT is a great help in these kinds of situations.
<cfsavecontent variale="myVar">
stuff goes here
<cfif blah>
more stuff
</cfif>
</cfsavecontent>
<cfmail to=...fill in the rest... >
#myVar#
</cfmail>
Fernis Guest



Reply With Quote

