User Guide
Receiving E-mail Messages 309
Receiving E-mail Messages
the Post Office Protocol tag, cfpop, expands your ability to add Internet mail client
features and e-mail consolidation to applications. While a conventional mail client
provides an adequate interface for personal mail, there are many cases in which an
alternative interface to some mailboxes is desirable.
cfpop is a tool to develop
targeted mail clients to suit the specific needs of a wide range of applications.
Use cfpop in applications when you want to receive e-mail. Here are two instances
in which implementing POP mail makes sense:
• If your site has generic mailboxes that are read by more than one person
(sales@yourcompany.com), it can be more efficient to construct a ColdFusion
mail front end to supplement individual user mail clients.
• In many applications, you can automate the processing of mail when the mail is
formatted to serve a particular purpose; for example, when subscribing to a list
server.
For more information on
cfpop syntax and variables, see the CFML Reference.
Using cfpop
Use the followig steps to add POP mail to your application
To implement the cfpop tag in your ColdFusion application:
1 Choose which mail boxes you want to access within your ColdFusion
application.
2 Determine what mail message components you must process: message header,
message body, attachments, and so on.
3 Decide whether you must store the retrieved messages in a database.
4 Decide whether you must delete messages from the POP server after you retrieve
them.
5 Incorporate the
cfpop tag in your application and create a user interface for
accessing a mailbox.
6 Build an application page to handle the output. Retrieved messages can include
ASCII characters that do not display properly in the browser.
You use the cfoutput tag with the HTMLCodeFormat and HTMLEditFormat
functions to control output to the browser. These functions convert characters
with special meanings in HTML, such as <, >, and &, into HTML escaped
characters, such as <, >, and &. The
HTMLCodeFormat tag also surrounds
the text in a
pre tag block. Note the use of these functions in the examples in this
chapter.