Using Queries to Send Mail to a List

Because ColdFusion is very adept at pulling multiple values from a database, let's look at how to use that function with <CFMAIL>. Let's say that, over the few months SuperView has been in business, the company has been collecting users'email addresses via a Web form and storing them in the database table "users".

Now the client has asked me to create an administration page for internal use that will enable SuperView employees to send mail to all registered users. The form she wants to use looks something like Figure 13.6.

Figure 13.6. A sample form designed to send email to multiple users via <CFMAIL>.

This ...

Get Sams Teach Yourself ColdFusion® in 21 Days now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.