Chapter 13: Sending and Receiving Email
209
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="[email protected]"
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
[email protected]
</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="[email protected]"
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:
Summary of Contents for COLDFUSION 4.5-DEVELOPING WEB
Page 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Page 14: ...xiv Developing Web Applications with ColdFusion...
Page 26: ...xxvi Developing Web Applications with ColdFusion...
Page 34: ...8 Developing Web Applications with ColdFusion...
Page 70: ...44 Developing Web Applications with ColdFusion...
Page 84: ...58 Developing Web Applications with ColdFusion...
Page 114: ...88 Developing Web Applications with ColdFusion...
Page 148: ...122 Developing Web Applications with ColdFusion...
Page 174: ...148 Developing Web Applications with ColdFusion...
Page 208: ...182 Developing Web Applications with ColdFusion...
Page 244: ...218 Developing Web Applications with ColdFusion...
Page 274: ...248 Developing Web Applications with ColdFusion...
Page 288: ...262 Developing Web Applications with ColdFusion...
Page 300: ...274 Developing Web Applications with ColdFusion...
Page 350: ...324 Developing Web Applications with ColdFusion...
Page 362: ...336 Developing Web Applications with ColdFusion...