BackUp LevelNext

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:

Company Name: #Company#
Contact: #FirstName# #LastName#

Address:
    #Address1#
    #Address2#
    #City#, #State# #Zip#

Phone: #Phone#
Fax: #Fax#
Home Page: #HomePageURL#

Please let us know if any of the above 
information has changed, or if we need to 
get in touch with someone else in your 
organization regarding this request.

Thanks,
Allaire Customer Service
service@allaire.com

</CFMAIL>

Note that in the TO attribute of CFMAIL, the #Email# query column causes one message to be sent to the address listed in each row of the query. Also note the use of the other query columns (FirstName, LastName, etc.) within the CFMAIL section to customize the contents of the message for each recipient.

Attaching a MIME file

In the following example, a MIME-encoded file is sent along with an email message:

<CFMAIL FROM="info@allaire.com"
    TO="jdoe@supercomputer.com"
    SUBJECT="File you requested"
    MIMEATTACH="c:\cfmanual.doc">

Dear Joe,

Here is a copy of the file you requested.

Regards,
The Allaire Team

</CFMAIL>

For more information about the attributes and values for the CFMAIL tag, see the CFML Language Reference.


BackUp LevelNext

allaire

AllaireDoc@allaire.com
Copyright © 1998, Allaire Corporation. All rights reserved.