I am having an issue with cfmail, that I think should work, but does not. See 
error in the commons below. I query a DB, which works fine, then I loop the 
results putting the cfmail inside of the loop, but what really concerns me is 
that CF does not recognize the #Email# for the To. I have tried, 
#GetMembers.Email# too, also to use query in the cfmail tag, but nothing seems 
to me working.

Can somebody help me on this one please? How to you query a db with cfmail and 
eemail this to all the people in your db. I have 12 members now, but it is 
growing.

Thanks so much,
John

<cfquery name="GetMembers" datasource="#REQUEST.dataSource#">
  SELECT *
  FROM members
</cfquery>

<cfloop query="GetMembers">
  <cfmail
        to="#Email#"
        from="[email protected]"
    subject="Test"
    type="HTML">
    
    <html>
    <head></head>
    <body>
             Greetings <cfoutput>#FirstName#</cfoutput>, and welcome to my mail!
    </body>
    </html>
  </cfmail>
</cfloop>

<!--- Error Message
Attribute validation error for the CFMAIL tag.

The value of the TO attribute is invalid. The length of the string, 0 
character(s), must be greater than or equal to 1 character(s).
 
The error occurred in /Library/WebServer/Documents/hfug/mail_test.cfm: line 8
6 : <cfloop query="GetMembers">
7 :   <cfmail
8 :     to="#Email#"
9 :     from="[email protected]"
10 :     subject="Test"

---> 

~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~|
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:4508
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