User Guide

Table Of Contents
974 Chapter 39: Sending and Receiving E-Mail
How ColdFusion sends mail
The ColdFusion implementation of SMTP mail uses a spooled architecture. If you select to spool
mail on the Mail page in the ColdFusion MX Administrator, when an application page processes
a
cfmail tag, the messages that are generated are not sent immediately. Instead, they are spooled
to disk and processed in the background. This architecture has two advantages:
End users of your application are not required to wait for SMTP processing to complete before
a page returns to them. This design is especially useful when a user action causes more than a
handful of messages to be sent.
Messages sent using cfmail are delivered reliably, even in the presence of unanticipated events
like power outages or server crashes.
You can set how frequently ColdFusion MX checks for spooled mail messages on the Mail page in
the ColdFusion MX Administrator. If ColdFusion is extremely busy or has a large existing queue
of messages, however, delivery can occur after the spool interval.
Some ColdFusion MX editions have advanced spooling options that let you fine tune how
ColdFusion sends mail. For more information, see Configuring and Administering
ColdFusion MX.
Error logging and undelivered messages
ColdFusion logs all errors that occur during SMTP message processing to the file mail.log in the
ColdFusion log directory. The log entries contain the date and time of the error as well as
diagnostic information about why the error occurred.
If a message is not delivered because of an error, ColdFusion writes it to this directory:
In Windows: \CFusionMX7\Mail\Undelivr
On UNIX: /opt/coldfusionmx7/mail/undelivr
The error log entry that corresponds to the undelivered message contains the name of the file
written to the UnDelivr (or undelivr) directory.
Note: To have ColdFusion try to resend a message that it could not deliver, move the message file
from the Undelivr directory to the Spool directory.
For more information about the mail logging settings in the ColdFusion MX Administrator, see
Configuring and Administering ColdFusion MX.
Sending e-mail messages
Before you configure ColdFusion to send e-mail messages, you must have access to an SMTP e-
mail server. Also, before you run application pages that refer to the e-mail server, you can
configure the ColdFusion MX Administrator to use the SMTP server. If you need to override the
ColdFusion MX Administrator SMTP server setting for any messages, you can specify a new mail
server in the
server attribute of the cfmail tag.