You can't have more than one query per cfmail tag. What you have to do is
build your message body outside of the message then output it.
Something like
<cfquery name="Get_emails_Shipto" datasource="test">
select Shipto_id,email_addr from ShipToTable
</cfquery>
<cfquery Name="Get_Orders" datasource="test">
Select OrderPart, OrderQty from OrdersTable where
OrderId="#Get_emails_Shipto.ShipTo_id#"
<cfloop query="Get_emails_ShipTo">
<cfset message_body = #Shipto_id#,#email_addr#>
<cfoutput query="Get_Orders>
<cfset message_body = message_body & "#OrderPart#, #OrderQty#">
</cfoutput>
<Cfmail from="[EMAIL PROTECTED]" to="#Get_emails_ShipTo.email_addr#"
type="HTML" subject="test">
#message_body#
</cfmail>
</cfloop>
I'm not sure that's right but you get the idea.
--K
====================
Katrina Chapman
Consultant
Ameriquest Mortgage
[EMAIL PROTECTED]
07/24/00 08:40 AM
Please respond to cf-talk
To: [EMAIL PROTECTED]
cc:
Subject: CFmail nesting outputs???
Hello all,
I am not able to nest queries in a CFMail, how do you
have more than one query in a CFmail, i cant group it either,
some like
<cfquery name="Get_emails_Shipto" datasource="test">
select Shipto_id,email_addr from ShipToTable
</cfquery>
<cfquery Name="Get_Orders" datasource="test">
Select OrderPart, OrderQty from OrdersTable where
OrderId="#Get_emails_Shipto.ShipTo_id#"
<cfloop query="Get_emails_ShipTo">
<Cfmail from="[EMAIL PROTECTED]" to="#Get_emails_ShipTo.email_addr#"
type="HTML" subject="test" query=>
<Cfoutput>
#Shipto_id#,#email_addr#
</cfoutput>
<!---******* this is not working ***********--->
<cfoutput query="Get_Orders>
#OrderPart#, #OrderQty#
</cfoutput>
</cfmail>
</cfloop>
What am i doing wrong here???
Appretiate any help
Thanks
Joe
-----
Sent using MailStart.com ( http://MailStart.Com/welcome.html )
The FREE way to access your mailbox via any web browser, anywhere!
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe'
in the body.
------------------------------------------------------------------------------
Archives: http://www.mail-archive.com/[email protected]/
To Unsubscribe visit
http://www.houseoffusion.com/index.cfm?sidebar=lists&body=lists/cf_talk or send a
message to [EMAIL PROTECTED] with 'unsubscribe' in the body.