Chapter 13: Sending and Receiving Email
the "ProductRequests" query, while the text above and below it serve as the header and
footer (respectively) for the mail message.
Sending email to multiple recipients
In the following example, a query ("CFBetaTesters") is run to retrieve a list of people
who are beta testing ColdFusion. This query is then used to send a notification to each
of these testers that a new version of the beta release is available:
<CFMAIL QUERY="CFBetaTesters"
FROM="beta@allaire.com"
TO="#TesterEMail#"
SUBJECT="ColdFusion Beta Four Available">
To all ColdFusion beta testers:
ColdFusion Beta Four is now available
for downloading from the Allaire site.
The URL for the download is:
http://beta.allaire.com
Regards,
ColdFusion Technical Support
beta@allaire.com
</CFMAIL>
Note that in this example, the contents of the CFMAIL tag are not dynamic, that is, they
don't use any # delimited dynamic parameters. What is dynamic is the list of email
addresses to which the message is sent. Note the use of the "TesterEMail" column from
the "CFBetaTesters" query in the TO attribute.
Customizing Email for Multiple Recipients
In the following example, a query ("GetCustomers") is run to retrieve the contact
information for a list of customers. This query is then used to send an email to each
customer asking them to verify that their contact information is still valid:
<CFMAIL QUERY="GetCustomers"
FROM="service@allaire.com"
TO="#EMail#"
SUBJECT="Contact Info Verification">
Dear #FirstName# -
We'd like to verify that our customer
database has the most up-to-date contact
information for your firm. Our current
information is as follows:
209