Whatever message this page gives is out now! Go check it out!
<cfpop
server = "server name"
action = "getHeaderOnly|getAll|delete|markRead"
attachmentPath = "path"
debug = "yes|no">
generateUniqueFilenames = "yes|no"
maxRows = "number"
messageNumber = "number"
name = "query name"
password = "password"
port = "port number"
secure = "yes|no">
startRow = "number"
timeout = "seconds"
uid = "number"
delimeter = "delimeter char"
username = "user name">| Attribute | Req/Opt | Default | Description |
server | Required | POP server identifier:
| |
action | Optional | getHeaderOnly |
|
attachmentPath | Optional | If action="getAll", specifies a directory in which to save any attachments. If the directory does not exist, ColdFusion creates it. If you omit this attribute, ColdFusion does not save any attachments. If you specify a relative path, the path root is the ColdFusion temporary directory, which is returned by the GetTempDirectory function. | |
debug | Optional | no |
|
generateUniqueFilenames | Optional | no |
|
maxRows | Optional | Retrieves all available rows | Number of messages to return or delete, starting with the number in startRow. Ignored if messageNumber or uid is specified. |
messageNumber | Message number or comma-separated list of message numbers to get or delete. Invalid message numbers are ignored.Ignored if uid is specified. | ||
name | Required if action = "getAll" or "getHeaderOnly" | Name for query object that contains the retrieved message information. | |
password | Optional | Password that corresponds to username. | |
port | Optional | 110 | POP port. |
secure | Optional | no | if set to yes, enables SSL for pop requests. |
startRow | Optional | 1 | First row number to get or delete. Ignored if messageNumber or uid is specified. |
timeout | Optional | 60 | Maximum time, in seconds, to wait for mail processing. |
uid | UID or a comma-separated list of UIDs to get or delete. Invalid UIDs are ignored. | ||
username | Optional | A user name. | |
| delimiter | Optional | The value of the uid attribute can be a comma-separated list of UIDs. If the delimiter attribute is specified, the value of delimiter will be used as a delimiter instead of comma. |
ram:///path| Variable names | Description |
queryname.recordCount | Number of records returned by query. |
queryname.currentRow | Current row that cfoutput is processing. |
queryname.columnList | List of column names in query. |
| Column name | getHeaderOnly returns | getAll returns |
queryname.date | yes | yes |
queryname.from | yes | yes |
queryname.messagenumber | yes | yes |
queryname.messageid | yes | yes |
queryname.replyto | yes | yes |
queryname.subject | yes | yes |
queryname.cc | yes | yes |
queryname.to | yes | yes |
queryname.body | no | yes |
queryname.textBody | no | yes |
queryname.HTMLBody | no | yes |
queryname.header | yes | yes |
queryname.attachments | no | yes |
queryname.attachmentfiles | no | yes |
queryname.UID | yes | yes |
queryname.cids | no | yes |
| Locale | How to create a ColdFusion date/time object from queryname.date |
English (US) | Use the ParseDateTime function. If you specify the pop-conversion attribute, the function adjusts the date/time object to UTC. |
Other | Extract the date part of string; pass it to the LSParseDateTime function. |
To set the default display format of date, time, number, and currency values, use the SetLocale function. |
<h3>cfpop Example</h3>
<p>cfpop lets you retrieve and manipulate mail in a POP3 mailbox.
This view-only example shows how to create one feature of
a mail client, to display the mail headers in a POP3 mailbox.
<p>To execute this, un-comment this code and run with a mail-enabled CF Server.
<cfif structKeyExists(form, "server")>
<!--- Make sure server, username are not empty. --->
<cfif len(trim(form.server)) and len(trim(form.username))>
<cfpop server = "#form.popserver#" username = "#form.username#" password = "#form.pwd#" action = "getHeaderOnly" name = "GetHeaders">
<h3>Message Headers in Your Inbox</h3>
<p>Number of Records:
<cfoutput>#GetHeaders.recordCount#</cfoutput></p>
<ul>
<cfoutput query = "GetHeaders">
<li>Row: #currentRow#: From: #From# -- Subject: #Subject#
</cfoutput>
</ul>
</cfif>
</cfif>
<form action = "cfpop.cfm " method = "post">
<p>Enter your mail server:</p>
<p><input type = "Text" name = "popserver"></p>
<p>Enter your username:</p>
<p><input type = "Text" name = "username"></p>
<p>Enter your password:</p>
<p><input type = "password" name = "pwd"></p>
<p><input type = "Submit" name = "get message headers"></p>
</form>