<cfpop>

edit

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
action
string, optional
edit

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

Get Headers Only

action="getHeaderOnly" - Retrieve email headers without body content

Attribute Description Default
connection
string, optional
edit

label for a connection.

server
string, optional
edit

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

port
number, optional
edit

Defaults to the standard POP port, 110.

username
string, optional
edit

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

password
string, optional
edit

Password that corresponds to user name.

secure
boolean, optional
edit

enables SSL for pop requests

timeout
number, optional
edit

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

name
string, optional
edit

Name for the index query.

Alias: variable

messageNumber
string, optional
edit

Can be a comma-separated list of the message ids

uid
string, optional
edit

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

maxRows
number, optional
edit

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
edit

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

delimiter
string, optional
edit

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

Alias: delimiters

Get Full Messages

action="getAll" - Retrieve complete email messages including body and attachments

Attribute Description Default
connection
string, optional
edit

label for a connection.

server
string, optional
edit

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

port
number, optional
edit

Defaults to the standard POP port, 110.

username
string, optional
edit

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

password
string, optional
edit

Password that corresponds to user name.

secure
boolean, optional
edit

enables SSL for pop requests

timeout
number, optional
edit

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

name
string, optional
edit

Name for the index query.

Alias: variable

messageNumber
string, optional
edit

Can be a comma-separated list of the message ids

uid
string, optional
edit

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

attachmentPath
string, optional
edit

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.

generateUniqueFilenames
boolean, optional
edit

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.

maxRows
number, optional
edit

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
edit

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

delimiter
string, optional
edit

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

Alias: delimiters

Delete Messages

action="delete" - Delete email messages from POP server

Attribute Description Default
connection
string, optional
edit

label for a connection.

server
string, optional
edit

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

port
number, optional
edit

Defaults to the standard POP port, 110.

username
string, optional
edit

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

password
string, optional
edit

Password that corresponds to user name.

secure
boolean, optional
edit

enables SSL for pop requests

timeout
number, optional
edit

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

messageNumber
string, optional
edit

Can be a comma-separated list of the message ids

uid
string, optional
edit

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

delimiter
string, optional
edit

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

Alias: delimiters

Unimplemented Attribute(s)

Attribute Description Default
debug
boolean, optional
edit

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

* deprecated *

Examples

edit

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