Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 1201

Developing applications
Hide thumbs Also See for 38043740 - ColdFusion Standard - Mac:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
Sending query-based e-mail
In the following example, a query (ProductRequests) retrieves a list of the customers who inquired about a product
during the previous seven days. ColdFusion sends the list, with an appropriate header and footer, to the marketing
department:
<cfmail
query="ProductRequests"
from="webmaster@MyCompany.com"
to="marketing@MyCompany.com"
subject="Widget status report">
Here is a list of people who have inquired about
MyCompany Widgets during the previous seven days:
<cfoutput>
#ProductRequests.FirstName# #ProductRequests.LastName# (#ProductRequests.Company#) -
#ProductRequests.EMailAddress#&##013;
</cfoutput>
Regards,
The webmaster
webmaster@MyCompany.com
</cfmail>
Reviewing the code
The following table describes the code:
Code
<cfoutput>
#ProductRequests.FirstName#
#ProductRequests.LastName#
(#ProductRequests.Company#) -
#ProductRequests.EMailAddress#&##013;
</cfoutput>
Sending e-mail to multiple recipients
In addition to simply using a comma-delimited list in the
recipients by using the
query
message to multiple recipients and how you can customize each message for the recipient.
Sending a simple message to multiple recipients
In the following example, a query (BetaTesters) retrieves a list of people who are beta testing ColdFusion. This query
then notifies each beta tester that a new release is available. The contents of the
is dynamic is the list of e-mail addresses to which the message is sent. Using the variable
to the TesterEmail column in the Betas table, in the
to
attribute of the
tag. The following examples show how you can send the same
cfmail
attribute, enables the dynamic list:
to
Last updated 1/20/2012
Description
Presents a dynamic list embedded within a normal message,
repeating for each row in the ProductRequests query. Because the
tag specifies a query, the
cfmail
cfoutput
attribute. The
forces a carriage return between output
&##013;
records.
attribute of the cfmail tag, you can send e-mail to multiple
tag body are not dynamic. What
cfmail
#TesterEMail#,
1196
tag does not use a
query
which refers

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents