Retrieving a message
When you use the
cfpop
with
, plus two additional columns,
getheaderonly
To retrieve an entire message:
Create a ColdFusion page with the following content:
1
<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>
</body>
</html>
Edit the following lines so that they refer to valid values for your POP mail server, username,
2
and password:
<cfpop server="mail.company.com"
username=#myusername#
password=#mypassword#
tag with
action="GetAll"
, ColdFusion returns the same columns as
and
.
body
header
Handling POP mail
801
Need help?
Do you have a question about the COLDFUSION MX 61-DEVELOPING COLDFUSION MX and is the answer not in the manual?
Questions and answers