ColdFusion 9.0 Resources |
Using ColdFusion with mail serversAdding 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, a valid POP account, or both. In your ColdFusion application pages, you use the cfmail and cfpop tags to send and receive e-mail, respectively. How ColdFusion sends mailThe 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 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. Error logging and undelivered messagesColdFusion 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. 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 Administrator, see Configuring and Administering ColdFusion. |