310
Chapter 16 Sending and Receiving E-mail
cfpop query variables
Two variables are returned for each
cfpop
query that provide record number
information:
•
RecordCount
The total number of records returned by the query.
•
CurrentRow
The current row of the query being processed by
cfoutput
in a
query-driven loop.
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>
Handling POP Mail
This section gives an example of each of the following usages:
•
Retrieving only message headers
•
Retrieving a message body
•
Retrieving attachments
•
Deleting messages
Retrieving only message headers
The header includes the following information. When you use
cfpop
to get the
header or the entire message, ColdFusion returns the values of each these fields in a
query column, with one record per retrieved message:
•
date
•
from
•
messageNumber
•
replyTo
•
subject
•
cc
•
to
To retrieve only the message header:
1
Create a new file in ColdFusion Studio.
2
Modify the file so that it appears as follows:
<html>
<head>
<title>POP Mail Message Header Example</title>
</head>
<body>
Summary of Contents for COLDFUSION 5-DEVELOPING
Page 1: ...Macromedia Incorporated Developing ColdFusion Applications MacroMedia ColdFusion 5 ...
Page 58: ...38 Chapter 3 Querying a Database ...
Page 134: ...114 Chapter 7 Updating Your Database ...
Page 210: ...190 Chapter 10 Reusing Code ...
Page 232: ...212 Chapter 11 Preventing and Handling Errors ...
Page 238: ...218 Chapter 12 Using the Application Framework ...
Page 262: ...242 Chapter 12 Using the Application Framework ...
Page 278: ...258 Chapter 13 Extending ColdFusion Pages with CFML Scripting ...
Page 320: ...300 Chapter 15 Indexing and Searching Data ...
Page 336: ...316 Chapter 16 Sending and Receiving E mail ...
Page 374: ...354 Chapter 18 Interacting with Remote Servers ...