User Guide

302 Chapter 16 Sending and Receiving E-mail
Using ColdFusion with Mail Servers
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. These are just a few examples:
Trigger e-mail messages based on users requests or orders.
Allow users to request and receive additional information or documents through
e-mail.
Confirm customer information based on order entries or updates.
Send invoices or reminders, using information pulled from database queries.
ColdFusion offers several ways to integrate e-mail into your applications. For
sending e-mail, you generally use the Simple Mail Transfer Protocol (SMTP). For
receiving 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 mail respectively. The following sections describe ColdFusion e-mail
features and offer examples of these tags.
Sending E-mail Messages
Before you set up 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 might want to configure the ColdFusion Administrator to use the SMTP
server so that you do not have to hard-code it in your application.
To configure ColdFusion for e-mail:
1 Open the Mail/Mail Logging page of the ColdFusion Administrator Server tab.
2 In the Mail Server box, enter the name or IP address of the SMTP mail server you
want ColdFusion to use.
3 Select the Verify Mail Server Connection check box to make sure ColdFusion can
access your mail server.
4 Leave the Server Port and Connection Timeout settings at their default values,
unless you need different settings.
5 Click Submit Changes to save the settings.
The page displays a message indicating success or failure at connecting to the server.
For more information on the Administrators mail settings, see Advanced ColdFusion
Administration.