Adding e-mail to your ColdFusion applications lets you respond automatically to user requests. You can use e-mail in your ColdFusion applications in many different ways, including the following:
ColdFusion offers several ways to integrate e-mail into your applications. To send e-mail, you generally use the Simple Mail Transfer Protocol (SMTP). To receive e-mail, you use the Post Office Protocol (POP) to retrieve e-mail from the mail server. To use e-mail messaging in your ColdFusion applications, you must have access to an SMTP server and/or a valid POP account.
In your ColdFusion application pages, you use the cfmail and cfpop tags to send and receive e-mail, respectively. The following sections describe how to use the ColdFusion e-mail features and show examples of these tags.
The ColdFusion implementation of SMTP mail uses a spooled architecture. If you select to spool mail on the Mail page in the ColdFusion 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:
You can set how frequently ColdFusion checks for spooled mail messages on the Mail page in the ColdFusion Administrator. If ColdFusion is extremely busy or has a large existing queue of messages, however, delivery can occur after the spool interval.
Some ColdFusion editions have advanced spooling options that let you fine tune how ColdFusion sends mail. For more information, see Configuring and Administering ColdFusion.
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:
The error log entry that corresponds to the undelivered message contains the name of the file written to the UnDelivr (or undelivr) directory.
For more information about the mail logging settings in the ColdFusion Administrator, see Configuring and Administering ColdFusion.