Adobe COLDFUSION 9 Manual page 1208

Developing applications
Hide thumbs Also See for COLDFUSION 9:
Table of Contents

Advertisement

DEVELOPING COLDFUSION 9 APPLICATIONS
Using External Resources
• header (A string with all the mail header fields, including entries that have separate fields in the query object)
• messageNumber (The sequential number of the message in the POP server; identical to the row number of the entry
in the query object)
• messageID (The mail header Message-ID field)
• replyTo
• subject
• cc
• to
• UID (The mail header X-UID field)
The
tag with the
cfpop
getHeaderOnly
attribute; otherwise, it does not get the attachments, and the attachmentfiles column contains empty strings.
Retrieve only the message header
1
Create a ColdFusion page with the following content:
<html>
<head>
<title>POP Mail Message Header Example</title>
</head>
<body>
<h2>This example retrieves message header information:</h2>
<cfpop server="mail.company.com"
username=#myusername#
password=#mypassword#
action="GetHeaderOnly"
name="Sample">
<cfoutput query="Sample">
MessageNumber: #HTMLEditFormat(Sample.messageNumber)# <br>
To: #HTMLEditFormat(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>
</cfoutput>
</body>
</html>
Edit the following lines so that they use valid values for your POP mail server, user name, and password:
2
<cfpop server="mail.company.com"
username=#myusername#
password=#mypassword#
3
Save the file as header_only.cfm in the myapps directory under your web_root and view it in your web browser:
This code retrieves the message headers and stores them in a
about working with recordset data, see
attribute retrieves any file attachments if you specify an
cfpop
"Using Query of
Queries" on page 428.
Last updated 8/5/2010
attachmentPath
recordset called Sample. For more information
1203

Advertisement

Table of Contents
loading

Table of Contents