Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chriss Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

multiple e-mails based on database flag 1

Status
Not open for further replies.

davejoyce

Programmer
Jun 26, 2000
29
US
I am trying to e-mail multiple contacts based on a flag in a database. It will not allow nesting of &lt;CFMAIL&gt; within &lt;CFOUTPUT&gt;. Any suggestions on how to do this??<br><br>The following code does not work:<br><br>&nbsp;&lt;CFQUERY DATASOURCE=&quot;xxx&quot;&gt;<br>&nbsp;UPDATE Broadcast_tbl<br>&nbsp;SET NewMessage = '#NewMessage#',<br>&nbsp;&lt;/cfquery&gt;<br><br>&nbsp;&lt;CFQUERY DATASOURCE=&quot;xxx&quot; NAME=&quot;notifyusers&quot;&gt;<br>&nbsp;select email <br>&nbsp;from personnel_tbl<br>&nbsp;where BroadcastNotify = 'Y'<br>&nbsp;&lt;/cfquery&gt;<br>&nbsp;<br>&nbsp;&lt;CFOUTPUT&gt;<br>&nbsp;<br>&nbsp;&lt;HTML&gt;<br>&nbsp;<br>&nbsp;&lt;HEAD&gt;<br>&nbsp;&lt;TITLE&gt; Boadcast Messages Updated&lt;/title&gt;<br>&nbsp;&lt;/head&gt;<br>&nbsp;<br>&lt;Body&gt;<br><br>&lt;H1&gt;&lt;B&gt;Broadcast Messages Updated&lt;/b&gt;&lt;/h1&gt;<br>&lt;/cfoutput&gt;<br><br><b>&lt;CFOUTPUT QUERY=&quot;notifyusers&quot;&gt;<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;CFMAIL QUERY=&quot;sendmail&quot;<br> TO=&quot;#email#&quot; <br> from=&quot;<A HREF="mailto:David_R_Joyce@xxx.com">David_R_Joyce@xxx.com</A>&quot;<br> Subject=&quot;New Broadcast Message&quot;&gt;<br> A new Broadcast Message Has Been Sent as Follows:<br> <br> #NewMessage#<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/cfmail&gt;<br>&lt;/cfoutput&gt;</b><br><br>&lt;/Body&gt;<br><br>&lt;/html&gt;<br><br>&nbsp;&nbsp;&nbsp;&nbsp;Thanks,<br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;Dave Joyce
 
Try using CFLOOP to loop through the query which should allow CFMAIL within the loop.
 
try this:<br>&lt;CFMAIL QUERY=&quot;notifyusers&quot;<br>TO=&quot;#email#&quot; <br>from=&quot;<A HREF="mailto:David_R_Joyce@xxx.com">David_R_Joyce@xxx.com</A>&quot;<br>Subject=&quot;New Broadcast Message&quot;&gt;<br>A new Broadcast Message Has Been Sent as Follows:<br><br>#NewMessage#<br>&lt;/cfmail&gt;<br><br><br>
 
achai,<br><br>&nbsp;&nbsp;It worked great, thanks for the help
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top