Got a query that returns some rows, with the output grouped.  I'm wanting
to construct a mail message inside the cfoutputs.
Basic idea of the code I've got just now, where I'm simply sending the
email without constructing it properly yet:

<cfquery name="queryName">
     SELECT Username, EmailAddress, ItemName
     FROM Users, Items
     WHERE Users.ID = Items.UserID
     ORDER BY Username, ItemName
</cfquery>

<cfoutput query="queryName" group="Username">
     #queryName.EmailAddress#

     <!--- email the user --->
     <cfmail from="me" to="#queryName.EmailAddress#" subject="test">
          blah
     </cfmail>

     <!--- display their items --->
     <cfoutput>
          - #queryName.ItemName#
     </cfoutput>
</cfoutput>


Sample output on the screen is

[EMAIL PROTECTED]
- Fish
- Paste

[EMAIL PROTECTED]
- Monkey
- Mince
- Cheese

How many emails should I get, two?  In this case I'm getting 5.  It only
displays 2 users, but does 5 cfmails.  Am I being particularly dumb or
something?
[CF 4.5]


Duncan Cumming
IT Manager

http://www.alienationdesign.co.uk
mailto:[EMAIL PROTECTED]
Tel: 0141 575 9700
Fax: 0141 575 9600

Creative solutions in a technical world

----------------------------------------------------------------------
Get your domain names online from:
http://www.alienationdomains.co.uk
Reseller options available!
----------------------------------------------------------------------
----------------------------------------------------------------------


-- 
** Archive: http://www.mail-archive.com/dev%40lists.cfdeveloper.co.uk/

To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]
For human help, e-mail: [EMAIL PROTECTED]

Reply via email to