You've passed a query to cfmail so it acts the same as:

<cfoutput query="someQuery">
    <cfmail />
</cfoutput>

Try removing the query attribute.

Adrian
http://www.adrianlynch.co.uk/

-----Original Message-----
From: Seamus Campbell
Sent: 02 January 2008 00:15
To: CF-Talk
Subject: cfmail question


Hi

I have the following code (at end of this email)
I want to send one email to admin_email but the code below sends multiple
emails - one for each record produced by the query.
I can't see why this is happening - any help gratefully received

<cfquery name="express_shopping_order" datasource="#request.dsn_main#">
SELECT token, stock_id, title, number_of_books, price, author
FROM tbl_shopping_cart_orders
WHERE token = '#token_ID#'
</cfquery>

<!--- send email to shop --->
<cfset shop_subject = "Express Order">
<cfset br = chr(13) & chr(10) />

<cfmail query="express_shopping_order" to="#request.admin_email#"
from="#request.admin_email#" subject="#shop_subject#"
server="#request.mail_server#">

#stock_id# - #author# #title# - #number_of_books# - #DollarFormat(price)#
#br#

</cfmail>


~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
Adobe® ColdFusion® 8 software 8 is the most important and dramatic release to 
date
Get the Free Trial
http://ad.doubleclick.net/clk;160198600;22374440;w

Archive: 
http://www.houseoffusion.com/groups/CF-Talk/message.cfm/messageid:295674
Subscription: http://www.houseoffusion.com/groups/CF-Talk/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.4

Reply via email to