<cfpop>

Retrieves and deletes e-mail messages from a POP mail server.

This tag cannot have a body.

This tag is also supported within <cfscript>

<cfpop connection=string server=string uid=string port=number username=string password=string secure=boolean action=getHeaderOnly|getAll|delete name=string messagenumber=string attachmentpath=string timeout=number debug=boolean maxrows=number startrow=number generateuniquefilenames=boolean delimiter=string >
Attribute Description Default
connection
string, optional

label for a connection.

server
string, optional

Host name biff.upperlip.com or IP address 192.1.2.225 of the POP server.

uid
string, optional

UID or a comma-delimited list of UIDs to get or delete. Invalid UIDs are ignored.

port
number, optional

Defaults to the standard POP port, 110.

username
string, optional

If no user name is specified, the POP connection is anonymous.

password
string, optional

Password that corresponds to user name.

secure
boolean, optional

enables SSL for pop requests

action
string, optional

Specifies the mail action.

  • getHeaderOnly: returns message header information only
  • getAll: returns message header information, message text, and attachments if attachmentPath is specified
  • delete: deletes messages on POP server

getHeaderOnly

name
string, optional

Name for the index query.

Alias: variable

messagenumber
string, optional

Can be a comma-separated list of the message ids

attachmentpath
string, optional

Allows attachments to be written to the specified directory when action = "getAll". If an invalid attachmentPath is specified, no attachment files are written to the server.

timeout
number, optional

Specifies the maximum time, in seconds, to wait for mail processing. Defaults is 60 seconds.

maxrows
number, optional

Sets the number of messages returned, starting with the number in the startRow attribute. This attribute is ignored if messageNumber is specified.

startrow
number, optional

Specifies the first row number to be retrieved. Default is 1. This attribute is ignored if messageNumber is specified.

generateuniquefilenames
boolean, optional

Boolean indicating whether to generate unique filenames for the files attached to an e-mail message to avoid naming conflicts when the files are saved. Default is NO.

delimiter
string, optional

Character that separates uid list, The default value is comma(,).

Alias: delimiters

Unimplemented Attribute(s)

Attribute Description Default
debug
boolean, optional

this attribute is deprecated and ignored, log control happens via the logging framework directly.

* deprecated *

Examples

Action getAll

<cfpop action="getAll" username="#username#" password="#password#" server="#server_name#" uid="#uid#" name="res">
<cfdump var="#res#" />

<cfpop action="getAll" username="#username#" password="#password#" server="pop.mail.com" port="995" secure="true" name="message" maxrows = "15" attachmentpath="#expandpath('./')#"> <cfdump var="#message#" />

Action getHeaderOnly

<cfpop action="getHeaderOnly" username="#username#" password="#password#" server="pop.mail.com" name="getHeader">
<cfdump var="#getHeader#" />

Action delete

<cfpop action="delete" username="#username#" password="#password#" server="pop.mail.com" uid="1RaJA7-1ioN2e27mu-00thu">

See also