Hi, John...

I don't use the 'query' attribute in my cfmail tag typically
(just preference, nothing wrong with it), but I suspect that
looping your "GetUsers" query, then using the 'query="GetUsers"'
attribute, as well, is complicating your mail generation.

Trying dropping with the loop and just use the attribute, 'query="GetUsers"',
or drop 'query="GetUsers"' and just use the cfloop query="GetUsers".

Rick

> -----Original Message-----
> From: John Barrett [mailto:[email protected]]
> Sent: Wednesday, January 21, 2009 2:24 AM
> To: cf-newbie
> Subject: cfmail& query users
> 
> Did I do something really wrong here?
> I am using cfmail to query a database to send a welcome mail for users in the 
> database. Instead of
> looping through the database, it takes the first filed and sends that for the 
> number of users in
there.
> There are 3 so if I run the code I get 3 mails in one account,and not the one 
> in the 3 mail
accounts.
> 
> <!---send emails--->
> <cfquery datasource="my_DSN" name="GetUsers">
>   select emailaddress, firstname
>   from emails
> </cfquery>
> 
> 
> <cfloop query="GetUsers">
> <cfmail to="#emailaddress#"
>       from="[email protected]"
>       subject="Hello From Got Nutrients?"
>       type="HTML"
>       query="GetUsers">
>       Dear #GetUsers.firstname#<br />
> 
>       We, here at Got Nutrients?, would like to thank you for joining.<br />
> 
>       Best wishes
>       John
> </cfmail>
> </cfloop>
> 
> 
> 
> 

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

Archive: 
http://www.houseoffusion.com/groups/cf-newbie/message.cfm/messageid:4304
Subscription: http://www.houseoffusion.com/groups/cf-newbie/subscribe.cfm
Unsubscribe: 
http://www.houseoffusion.com/cf_lists/unsubscribe.cfm?user=11502.10531.15

Reply via email to