Home Site Map Buy Email
AdvSMTP
AdvIMAP4
AdvPOP3
AdvFile
AdvZIP
AdvGraphGenerator
AdvLDAP
AdvHTTP
AdvDSN
AdvDirectory
AdvRegistry
AdvMX
ASP Components >> AdvPOP3 >> CF_POP
Download | Buy
CF_POP

CF_POP

CF_POP retrieves and deletes email messages from a POP3 mail server. See also CF_MAIL.

Syntax

<CF_POP SERVER="servername"
    PORT="port_number"
    USERNAME="username"
    PASSWORD="password"
    ACTION="action"
    NAME="queryname"
    MESSAGENUMBER="number"
    ATTACHMENTPATH="path"
    ATTACHMENTPATHHTTP="url_path"
    DOWNLOADEDUIDS="uid"
    ORDERBY="sorting_criteria"
    SORTFIRST="boolean"
    TIMEOUT="seconds">

SERVER

Required. POP3 server name or IP address.

PORT

Optional. Defaults to the standard POP3 server port, 110.

USERNAME

Optional. POP3 account user name, required for authentication. If no user name is specified, the authentication is anonymous.

PASSWORD

Optional. POP3 account password, required for authentication.

ACTION

Required. Specifies the action. These are possible values

  • GetHeaderOnly
  • (default) returns message header information only
  • GetAll
  • returns message header information, message body, and attachments if ATTACHMENTPATH parameter is specified
  • Delete
  • deletes messages on the POP3 server
  • Status
  • returns the current status of mailbox

NAME

Optional. The name to assign to a query when a query is constructed from CF_POP. If no name is specified then a default name CF_POP is used to construct query.

MESSAGENUMBER

Optional. Required for Delete, GetHeaderOnly (optional, if not specified then all messages are selected) and GetAll (optional, if not specified then all messages are selected). Message sequence numbers of messages, for performing action. We can also write it as 3:8 means messages with sequence number starts from 3 and ends at 8. Also 3,8 (comma separated list) can be given which means messages with sequence number 3 and 8 only.

ATTACHMENTPATH

Optional. The physical path where attachments will be saved. If an invalid ATTACHMENTPATH is specified, no attachment files are written to the server.

ATTACHMENTPATHHTTP

Optional. URL for the ATTACHMENTPATH where attachments are saved. This is used to handle the case of embedded images.

DOWNLOADEDUIDS

Optional. This attribute is optional. The UIDs of messages previously downloaded from server. Used to determine which messages are new. We can also write it as 3:8 means do not download messages with UIDs starts from 3 and ends at 8. Also 3,8 (comma separated list) can be given which means do not download messages with sequence number 3 and 8 only.

ORDERBY

Optional. Required for GetHeaderOnly (optional), GetAll (optional) for sorting of mails. If not specified then no sorting is performed and mail messages are returned in order as returned by POP3 server. Valid sorting criteria are

  • Subject_ASC
  • Subject_DESC
  • From_ASC
  • From_DESC
  • To_ASC
  • To_DESC
  • Date_ASC
  • Date_DESC
  • Size_ASC
  • Size_DESC
  • Attachment_ASC (mails without attachment are returned first)
  • Attachment_DESC (mails with attachment are returned first)

SORTFIRST

Optional. Required for GetHeaderOnly (optional) for sorting mail messages first and then return required mail messages. This parameter is only valid for GetHeaderOnly and ignored in case of GetAll. If parameter MessageNumber contains 1:5 and this parameter is set as TRUE, the component will fetch all messages first and will sort on given sorting criteria and will return mail messages that come in sequence from 1 to 5, and if this parameter is set as FALSE, the component will fetch messages from 1 to 5 and will sort on given sorting criteria and will return mail messages. Valid values are

  • TRUE
  • if this value is set as TRUE then component will fetch all messages, perform sorting and then will return required messages
  • FALSE (default)
  • if this value is set as TRUE then component will fetch required mesages, perform sorting and then will return those messages

TIMEOUT

Optional. Specifies the maximum amount of time in seconds to wait for mail processing. Defaults to 60 seconds.

CF_POP query variables

The following table describes the query variables that are returned by CF_POP. The example illustrates their use.


CF_POP query variables 
Variable NameDescription
queryname.RecordCount
contains total number of records returned by the query.
queryname.CurrentRow
contains current row of the query being processed by CFOUTPUT.
queryname.ColumnList
contains list of the column names in the query.

Message Header and Body columns

The following table lists the message header and body columns that are returned by CF_POP when you specify the ACTION attribute to be either GetHeaderOnly or GetAll. All of the columns are returned if you specify GetAll, but only header information is returned when you specify GetHeaderOnly.


CF_POP query variables 
Column NameGetHeaderOnly returns GetAll returns Description
queryname.MessageNo
yesyescontains message sequence number of the message.
queryname.Priority
yesyescontains priority number of the message.
queryname.Date
yesyescontains mail date.
queryname.MessageID
yesyescontains message id.
queryname.MIMEVersion
yesyescontains valid version for the MIME.
queryname.ContentType
yesyescontains content type, means what type of message it is.
queryname.From
yesyescontains mail address of the sender of the mail.
queryname.To
yesyescontains receiver address(s).
queryname.ReplyTo
yesyescontains reply address.
queryname.CC
yesyescontains CC address(s).
queryname.Subject
yesyescontains subject of the mail.
queryname.XMailer
yesyescontains value for X-Mailer header.
queryname.UID
yesyescontains UID for the mail.
queryname.Status
yesyescontains value of the current status of the mail.
queryname.Size
yesyescontains size of mail.
queryname.Body
not availableyescontains body of the mail.
queryname.HTMLBody
not availableyescontains HTML body of the mail, if mail is sent in HTML format.
queryname.AttachmentSent
not availableyescontains a tab-separated list of all source attachment names.
queryname.AttachmentSaved
not availableyescontains a tab-separated list of all saved file names. In case a file name already exists at the destination path with the name sent from the POP3 server, CF_POP tag will change it to a unique file name before saving it.
queryname.AttachmentFiles
not availableyescontains a tab-separated list of the actual filenames written to the server. This is the absolute path on the server's hard disc after making names unique if required.

There can be many other extra headers. To retrieve all extra headers, please see the following table.

CF_POP extra headers query variables 
Variable NameDescription
queryname_#messageno#_ExtraHeaders.Name
contains name of the header.
queryname_#messageno#_ExtraHeaders.Value
contains value of the header.

CF_POP variables

See the following table for all the variables returned by CF_POP in case ACTION attribute is set as Status.

CF_POP variables 
Variable NameDescription
#CF_POP.Count#
contains total number of messages in mailbox.
#CF_POP.Size#
contains total size of the mailbox.

Example

<!--- This example shows the use of CF_POP --->

<HTML>
<HEAD>
	<TITLE>CF_POP Example</TITLE>
</HEAD>
<BODY>

<H3>CF_POP Example</H3>

<P>CF_POP allows you to retrieve and manipulate mail 
in 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>

<CF_POP SERVER="#server#"
        USERNAME=#username#
        PASSWORD=#password#
        ACTION= "GETHEADERONLY"
        NAME= "GetHeaders">

Total messages in your inbox are
<CFOUTPUT>#GetHeaders.RecordCount#</CFOUTPUT>

<UL>
    <CFOUTPUT QUERY="GetHeaders">
        <LI>
	    Current row: #CurrentRow#:
	    From: #From#
	    Subject: #Subject#
        </LI>
    </CFOUTPUT>
</UL>
	
</BODY>
</HTML>