User Guide

Table Of Contents
Using the cfmailparam tag 981
Reviewing the code
The following table describes the code and its function:
Using the cfmailparam tag
You use the cfmailparam tag to include files in your message or add a custom header to an e-mail
message. You can send files as attachments or display them inline in the message. You nest the
cfmailparam tag within the cfmail tag.
Attaching files to a message
You can use one
cfmailparam tag for each attachment, as the following example shows:
<cfmail from="daniel@MyCompany.com"
to="jacob@YourCompany.com"
subject="Requested Files">
Jake,
Here are the files you requested.
Regards,
Dan
<cfmailparam file="c:\widget_launch\photo_01.jpg">
<cfmailparam file="c:\widget_launch\press_release.doc">
</cfmail>
Code Description
<cfquery name="GetCustomers"
datasource="myDSN">
SELECT * FROM Customers
</cfquery>
Retrieves all data from the Customers table into a query
named GetCustomers.
<cfmail query="GetCustomers"
from="service@MyCompany.com"
to="#GetCustomers.EMail#"
subject="Contact Info
Verification">
Uses the to attribute of cfmail, the
#GetCustomers.Email# query column causes one
message to be sent to the address listed in each row of
the query. Therefore, the mail body does not use a
cfoutput tag.
Dear #GetCustomers.FirstName#
...
Company Name: #GetCustomers.Company#
Contact: #GetCustomers.FirstName#
#GetCustomers.LastName#
Address:
#GetCustomers.Address1#
#GetCustomers.Address2#
#GetCustomers.City#,
#GetCustomers.State#
#GetCustomers.Zip#
Phone: #GetCustomers.Phone#
Fax: #GetCustomers.Fax#
Home Page: #GetCustomers.HomePageURL#
Uses other query columns (#GetCustomers.FirstName#,
#GetCustomers.LastName#, and so on) within the cfmail
section to customize the contents of the message for
each recipient.