Retrieves and deletes e-mail messages from a POP mail server.
<cfpop server = "servername" port = "port_number" username = "username" password = "password" action = "action" name = "queryname" messageNumber = "number" attachmentPath = "path" timeout = "seconds" maxRows = "number" startRow = "number" generateUniqueFilenames = "boolean">
cfftp,
cfhttp,
cfldap,
cfmail,
cfmailparam
Note Two retrieve options are offered to maximize performance. Message header information is typically short and therefore quick to transfer. Message text and attachments can be very long and therefore take longer to process. See the Message Header and Body Columns table, which follows the |
The following table describes the query variables that are returned by cfpop
.
The following table lists the message header and body columns returned by cfpop
when you specify the action
attribute as either getHeaderOnly
or getAll
.
To create a ColdFusion date/time object from the date-time string that is extracted from a mail message in the queryname.date column
, use the following table.
Locale |
What to do |
---|---|
English (US) locale |
Use the ParseDateTime function and specify the POP attribute, which converts the date-time value to Greenwich Mean Time. |
Other locales |
Extract the date portion of the string and pass it to the LSParseDateTime function, then add or subtract the conversion time, depending on the locale. |
See also the description of the SetLocale function.
For complete usage information on cfpop
, see Developing ColdFusion Applications.
<!--- This view-only example shows the use of cfpop ---> <html> <head> <title>cfpop Example</title> </head> <body> <H3>cfpop Example</H3> <P>cfpop allows you to retrieve and manipulate mailin a POP3 mailbox. This view-only example shows how to create one feature of a mail client, allowing you to display the mail headers in a POP3 mailbox. <P>Simply uncomment this code and run with a mail-enabled CF Server to see this feature in action. <!--- <cfif IsDefined("form.server ")> <!--- make sure server, username are not empty ---> <cfif form.server is not "" and form.username is not ""> <cfpop server = "#server# " username = #UserName# password = #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><input type = "Text " name = "server "> <P>Enter your username: <P><input type = "Text " name = "username "> <P>Enter your password: <P><input type = "password " name = "pwd "> <input type = "Submit " name = "get message headers "> </form> ---> </body> </html>