User Guide

Table Of Contents
984 Chapter 39: Sending and Receiving E-Mail
Using the cfpop tag
Use the following steps to add POP mail to your application.
To implement the cfpop tag in your application:
1.
Choose the mailboxes to access within your ColdFusion application.
2.
Determine which 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 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 the less than (<), greater than (>), and ampersand (&) symbols, into HTML-escaped
characters, such as &lt;, &gt;, and &amp;. The
HTMLCodeFormat tag also surrounds the text in a
pre tag block. The examples in this chapter use these functions.
The cfpop query variables
Like any ColdFusion query, each
cfpop query returns variables that provide information about
the record:
RecordCount The total number of records returned by the query.
ColumnList A list of the headings of the columns that are returned by the query
CurrentRow The current row of the query being processed by cfoutput or cfloop in a query-
driven loop.
The query includes one variable that is not returned by the
cfquery tag: the UID variable
contains the unique identifier of the e-mail message file.
You can reference these properties in a
cfoutput tag by prefixing the query variable with the
query name in the
name attribute of cfpop:
<cfoutput>
This operation returned #Sample.RecordCount# messages.
</cfoutput>