Sending Smtp E-Mail With Cfmail - MACROMEDIA COLDFUSION MX 61-DEVELOPING COLDFUSION MX Develop Manual

Developing coldfusion mx applications
Table of Contents

Advertisement

Sending SMTP e-mail with cfmail

The
tag provides support for sending SMTP e-mail from within ColdFusion applications.
cfmail
The
tag is similar to the
cfmail
SMTP mail messages rather than to a page. The
commands that you use with
important
cfmail
Attribute
Description
subject
The subject of the message.
from
The e-mail address of the sender.
to
The e-mail address of the recipient. Use a comma-delimited list to specify multiple
recipients.
cc
(Optional) The e-mail address of a carbon copy recipient. The recipient's address is
visible to other recipients. Use a comma-delimited list to specify multiple cc
recipients.
bcc
(Optional) The e-mail address of a blind carbon copy recipient. The recipient's
address is not visible to other recipients. Use a comma-delimited list to specify
multiple bcc recipients.
SpoolEnable
(Optional) When
operation is complete.
To 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 MX">
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
Open your browser and enter the following URL:
3
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
cfoutput
, including
cfoutput
tag attributes:
SpoolEnable="yes"
tag, except that
cfmail
tag supports all the attributes and
cfmail
. The following table describes
query
, saves a copy of the message until the sending
"Sending e-mail messages" on page
outputs the generated text as
Sending e-mail messages
790.
791

Advertisement

Table of Contents
loading
Need help?

Need help?

Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?

Questions and answers

Subscribe to Our Youtube Channel

This manual is also suitable for:

Coldfusion mx

Table of Contents