Adobe 38043740 - ColdFusion Standard - Mac Development Manual page 1204

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

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
Code
<cfquery name="GetCustomers" datasource="myDSN">
SELECT * FROM Customers
</cfquery>
<cfmail query="GetCustomers"
from="service@MyCompany.com"
to="#GetCustomers.EMail#"
subject="Contact Info Verification">
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#
Digitally signing e-mail
To add digital signature to your mail, specify the attributes
as provided in the following example:
keypassword
<cfmail from="Sender@Company.com" server="sendmail.myCo.com" sign="true"
keystore="C:\OpenSSL\bin\hello.jks" keystorepassword="digital" to="Recepient@Company.com"
keyalias="crypto" keypassword="signature" subject="Mail with Digital Signature">
To add digital signature to all the mails you send, instead of adding the attributes to the tag, specify the settings in the
Server Settings > Settings page of the ColdFusion Administrator.
The supported keystores are JKS and PKCS12.
Due to import control restrictions in various countries, the policy files (local_policy.jar and US_export_policy.jar)
support only limited cryptography. If the key strength exceeds the limit, you might encounter the error suggesting that
the keystore cannot be loaded. If you are from an eligible country, you can download the unlimited strength version of
the policy files and replace the default cryptography JAR files with them. The files are available on the Java SDK web site.
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
Attaching files to a message
You can use one
cfmailparam
Description
Retrieves all data from the Customers table into a query named
GetCustomers.
Uses the
column causes ColdFusion to send one message to the address listed
in each row of the query. Therefore, the mail body does not use a
cfoutput
Uses other query columns (
#GetCustomers.LastName#
to customize the contents of the message for each recipient.
sign
tag for each attachment, as the following example shows:
Last updated 1/20/2012
to
attribute of
cfmail
, the
#GetCustomers.Email#
tag.
#GetCustomers.FirstName#
, and so on) within the
,
,
keystore
keystorepassword
tag within the cfmail tag.
cfmailparam
1199
query
,
section
cfmail
,
, and
keyalias

Advertisement

Table of Contents
loading

This manual is also suitable for:

Coldfusion 9

Table of Contents