User Guide

Table Of Contents
Handling POP mail 987
#HTMLCodeFormat(queryname.messageNumber)#
</cfoutput>
For information on these ColdFusion functions, see CFML Reference.
Retrieving messages
When you use the
cfpop tag with action="GetAll", ColdFusion returns the same columns as
with
getheaderonly, plus the following additional columns:
attachments (A tab-delimited list of attachment file names)
attachmentfiles (A tab-delimited list of paths to the attachment files retrieved to the local
server, if any. You get the files only if you specify an
attachmentpath attribute.)
body
htmlbody
textbody
If the message is multipart, the htmlbody and textbody fields contain the contents of the HTML
and plain text parts, and the body field has the first part in the message. If the message has only
one part, the body contains the message, and either the htmlbody or textbody field, depending on
the message type, also has a copy of the message.
To retrieve entire messages:
1.
Create a ColdFusion page with the following content:
<html>
<head><title>POP Mail Message Body Example</title></head>
<body>
<h2>This example adds retrieval of the message body:</h2>
<cfpop server="mail.company.com"
username=#myusername#
password=#mypassword#
action="GetAll"
name="Sample">
<cfoutput query="Sample">
MessageNumber: #HTMLEditFormat(Sample.messageNumber)# <br>
To: #Sample.to# <br>
From: #HTMLEditFormat(Sample.from)# <br>
Subject: #HTMLEditFormat(Sample.subject)# <br>
Date: #HTMLEditFormat(Sample.date)#<br>
Cc: #HTMLEditFormat(Sample.cc)# <br>
ReplyTo: #HTMLEditFormat(Sample.replyTo)# <br>
<br>
Body:<br>
#Sample.body#<br>
<br>
Header:<br>
#HTMLCodeFormat(Sample.header)#<br>
<hr>
</cfoutput>