Adobe COLDFUSION 9 Manual page 1199

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
Attribute
Description
to
The e-mail address of the recipient. Use a comma-delimited list to specify multiple recipients.
(Optional) The e-mail address of a carbon copy recipient. The recipient address is visible to other recipients. Use
cc
a comma-delimited list to specify multiple cc recipients.
bcc
(Optional) The e-mail address of a blind carbon copy recipient. The recipient address is not visible to other
recipients. Use a comma-delimited list to specify multiple bcc recipients.
Send a simple e-mail message
Create a ColdFusion page with the following content:
1
<html>
<head>
<title>Sending a simple e-mail</title>
</head>
<body>
<h1>Sample e-mail</h1>
<cfmail
from="Sender@Company.com"
to="#URL.email#"
subject="Sample e-mail from ColdFusion">
This is a sample e-mail message to show basic e-mail capability.
</cfmail>
The e-mail was sent.
</body>
</html>
Save the file as send_mail.cfm in the myapps directory under your web_root directory.
2
3
Open your browser and enter the following URL:
http://localhost:8500/myapps/send_mail.cfm?email=myname@mycompany.com
(Replace myname@mycompany.com with your e-mail address.)
The page sends the e-mail message to you, through your SMTP server.
Note: If you do not receive an e-mail message, check whether you have configured ColdFusion to work with your SMTP
server; for more information, see
The
tag has many options that let you customize your mail or control how it is sent. For a description of all
cfmail
attributes, including options to wrap mail text at a specified column, specify the mail character encoding, and specify
the mail server, user name, and password, see the cfmail description in the CFML Reference.
Sending HTML e-mail
If you know all the mail recipients use mail applications that are capable of reading and interpreting HTML code in a
mail message, you can use the cfmail tag to send an HTML message. The
the receiving e-mail client that the message contains embedded HTML tags that must be processed. For an example
that sends HTML mail, see
"Including images in a
"Sending e-mail
messages" on page 1193.
message" on page 1200.
Last updated 8/5/2010
tag
attribute informs
cfmail
type="HTML"
1194

Advertisement

Table of Contents
loading

Table of Contents