Title: Message
If you emailing a single person or the content of the CFMAIL body contains the same information for everyone, you can build the Body portion of the CFMAIL tag prior to using the CFMAIL tag.

Example:
<CFSET EmailBody = "">
 
<--- Perform a query, loop, etc. and add the results to the EmailBody variable: --->
<CFQUERY NAME="Info" DATASOURCE="Test">
SELECT * FROM TEST
</CFQUERY>
<CFOUTPUT QUERY="Info">
<CFSET EmailBody = EmailBody + "Question: " + Info.Question + " Answer: " + Info.Answer + "<BR>">
</CFOUTPUT>
 
<CFMAIL TO="" FROM="">
#variables.EmailBody#
</CFMAIL>
 
 
Randy Ellis
City of Overland Park
Senior Programmer Analyst
-----Original Message-----
From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED] On Behalf Of Adaryl Wakefield
Sent: Monday, May 24, 2004 1:40 PM
To: [EMAIL PROTECTED]
Subject: [KCFusion] cfmail

I am struggling with a work around for the cfmail tag. Im yanking some info that needs to be grouped properly the problem is I can't seem to do it right in a cfmail tag. ive got this
 
SELECT   table1.Category, table2.question, table3.answer, table4.url, table4.urlText, table2.question_ID
FROM      table1, table2, table3, table4
WHERE  table1.cat_num = table2.cat_num AND table2.question_ID = table3.question_ID AND table2.question_ID *= table4.question_ID and table2.question_ID = #url.id#
 
the information from table1 and table2 only needs to come out once. the information from table3 and table4 need to come out grouped on table2.question_ID
 
I can't group in a loop and I can't leave the query attribute out of the mail tag and just use cfoutput cause it tosses and error.
Im using CFMX on Win2k
 
Adaryl "Did you reboot?" Wakefield
Aviator by passion
Programmer by sheer force of will

Reply via email to