User Guide

Table Of Contents
973
CHAPTER 39
Sending and Receiving E-Mail
You can add interactive e-mail features to your ColdFusion applications using the cfmail and
cfpop tags. This complete two-way interface to mail servers makes the Macromedia
ColdFusion MX e-mail capability a vital link to your users.
Contents
Using ColdFusion with mail servers. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 973
Sending e-mail messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 974
Sample uses of the cfmail tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 977
Using the cfmailparam tag . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 981
Receiving e-mail messages . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 983
Handling POP mail. . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 985
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, including the
following:
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. 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.