User Guide

214 Developing Web Applications with ColdFusion
Cc: #HTMLEditFormat(Sample.CC)# <BR>
ReplyTo: #HTMLEditFormat(Sample.REPLYTO)# <BR>
</CFOUTPUT>
</BODY>
</HTML>
3. Change the following line so that it refers to a valid POP mail server, as well as a
valid user name and password:
<CFPOP SERVER="mail.company.com"
USERNAME=#username#
PASSWORD=#password#
4. Save the file as hdronly.cfm in myapps under the Web root directory.
This code retrieves the message headers and stores them in a CFPOP result set called
Sample.
You can enclose header information in HTML coding and use the ColdFusion function
HTMLCodeFormat to replace HTML tags with escaped characters, such as &gt; for >
and
&lt; for <.
In addition, you can process the date returned by CFPOP with ParseDateTime, which
accepts an argument for converting POP date/time objects into GMT (Greenwich
Mean Time).
See the CFML Language Reference for information on these ColdFusion functions.
You can reference any of these columns in a CFOUTPUT tag, as the following example
shows.
<CFOUTPUT>
#ParseDateTime(queryname.date, "POP")#
#HTMLCodeFormat(queryname.from)#
#HTMLCodeFormat(queryname.messagenumber)#
</CFOUTPUT>
Returning an entire message
When you use the CFPOP tag with ACTION="GetAll", ColdFusion returns the same
columns returned with GETHEADERONLY, as well as two additional columns, BODY
and HEADER.
To retrieve an entire message:
1. Create a new file in Studio.
2. Modify the file so that it appears as follows:
<HTML>
<HEAD>
<TITLE>POP Mail Message Body Example</TITLE>
</HEAD>
<BODY>
<H2>This example adds retrieval of