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
>
for
>
and
<
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
Summary of Contents for COLDFUSION 4.5-DEVELOPING WEB
Page 1: ...Allaire Corporation Developing Web Applications with ColdFusion ColdFusion 4 5...
Page 14: ...xiv Developing Web Applications with ColdFusion...
Page 26: ...xxvi Developing Web Applications with ColdFusion...
Page 34: ...8 Developing Web Applications with ColdFusion...
Page 70: ...44 Developing Web Applications with ColdFusion...
Page 84: ...58 Developing Web Applications with ColdFusion...
Page 114: ...88 Developing Web Applications with ColdFusion...
Page 148: ...122 Developing Web Applications with ColdFusion...
Page 174: ...148 Developing Web Applications with ColdFusion...
Page 208: ...182 Developing Web Applications with ColdFusion...
Page 244: ...218 Developing Web Applications with ColdFusion...
Page 274: ...248 Developing Web Applications with ColdFusion...
Page 288: ...262 Developing Web Applications with ColdFusion...
Page 300: ...274 Developing Web Applications with ColdFusion...
Page 350: ...324 Developing Web Applications with ColdFusion...
Page 362: ...336 Developing Web Applications with ColdFusion...