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

If you are looking for an easy to use and reliable POP3 component -- you have found the source!

AdvPOP3 is a high performance and easy-to-use POP3 component (mail component). It allows you to retrieve and delete mail messages from any standard POP3 server, which complies with RFC 1939, via a web page and offer functionality that POP3 server support. Access to the component can also be turned on and of or any website on the server, thus making it perfectly secure for shared hosting environment. The component exposes message headers via properties and handles quoted-printable and base64 decoding file attachments and embedded images also. AdvPOP3 supports all operations of POP3 protocol and provides many advanced features as follows:

Retrieve mail messages using message numbers and also can sort the messages in given ascending and descending criteria.
Delete mail messages.
Check current status, as number of mail messages present and total size.
It also provides Download and DownloadAs operations. Download operation allows downloading a file to client browser with actual file name and DownloadAs operation allows downloading a file to client browser with specified name. These operations can be used to download attachments to client machine.

ASPFusion also provides ColdFusion custom tag CF_POP written on AdvPOP3 component. This helps coldfusion developers in making a better understanding, in case they are using AdvPOP3 component.

Sample code for C++, ASP and CF is provided with the component.

Example (ASP):

<% set Obj = Server.CreateObject("AdvPOP3.POP3") %>

Example (ColdFusion):

<CFOBJECT Class="AdvPOP3.POP3" Action="Create" Name="Obj">

AdvPOP3 Properties

Property Description
AttachmentPath The physical path where attachments will be saved.

Example (ASP):
<% Obj.AttachmentPath = "c:\myfolder\attachments" %>

Example (ColdFusion):
<CFSET Obj.AttachmentPath = "c:\myfolder\attachments">
AttachmentPathError Returns 1 if any error occurred for AttachmentPath otherwise 0.

Example (ASP):
<% if Obj.AttachmentPathError = 1 then
        Response.Write Obj.AttachmentPathErrorReason
end if %>

Example (ColdFusion):
<CFIF #Obj.AttachmentPathError# EQ 1>
        <CFOUTPUT>#Obj.AttachmentPathErrorReason#</CFOUTPUT>
</CFIF>
AttachmentPathErrorReason Reports any error that occurred for AttachmentPath.

Example (ASP):
<% if Obj.AttachmentPathError = 1 then
        Response.Write Obj.AttachmentPathErrorReason
end if %>

Example (ColdFusion):
<CFIF #Obj.AttachmentPathError# EQ 1>
        <CFOUTPUT>#Obj.AttachmentPathErrorReason#</CFOUTPUT>
</CFIF>
AttachmentPathHTTP URL for the AttachmentPath where attachments are saved. This is used to handle the case of embedded images.

Example (ASP):
<% Obj.AttachmentPathHTTP = "http://advancedwebmail.com/attachments" %>

Example (ColdFusion):
<CFSET Obj.AttachmentPathHTTP = "http://advancedwebmail.com/attachments">
DeleteFile This property is used to set flag whether to delete the file from server after downloading through Download or DownloadAs methods. Valid values are

TRUE if this flag is set as TRUE then component will delete the file from server after downloading
FALSE (default) if this flag is set as FALSE then component will not delete the file from server after downloading

Example (ASP):
<% Obj.DeleteFile = true %>

NOTE: Can only be used for ASP
DownloadedUIDs 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.

Example (ASP):
<% Obj.DownloadedUIDs = "2,5,8,12,17" %>

Example (ColdFusion):
<CFSET Obj.DownloadedUIDs = "2,5,8,12,17">
DownloadForceFully This property is used to inform AdvFile component whether to download file forcefully through Download or DownloadAs methods. Valid values are

TRUE if this flag is set as TRUE then component will download file forcefully
FALSE (default) if this flag is set as FALSE then component will not download file forcefully, browser will decide whether to display or download the file

Example (ASP):
<% Obj.DownloadForceFully = true %>

NOTE: Can only be used for ASP.
ErrorReason Reports any error that occurred during the request.

Example (ASP):
<% if Obj.IsError = 1 then
        Response.Write Obj.ErrorReason
else
        No Error Occurred
end if %>

Example (ColdFusion):
<CFIF #Obj.IsError# EQ 1>
        <CFOUTPUT>#Obj.ErrorReason#</CFOUTPUT>
<CFELSE>
        <CFOUTPUT>No Error Occurred</CFOUTPUT>
</CFIF>
IsError Returns 1 if any error occurred during the request otherwise 0.

Example (ASP):
<% if Obj.IsError = 1 then
        Response.Write Obj.ErrorReason
else
        No Error Occurred
end if %>

Example (ColdFusion):
<CFIF #Obj.IsError# EQ 1>
        <CFOUTPUT>#Obj.ErrorReason#</CFOUTPUT>
<CFELSE>
        <CFOUTPUT>No Error Occurred</CFOUTPUT>
</CFIF>
MessageNumber 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.

Example (ASP):
<% Obj.MessageNumber = "2,5,8,12,17" %>

Example (ColdFusion):
<CFSET Obj.MessageNumber = "2,5,8,12,17">
OrderBy 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)

Example (ASP):
<% Obj.OrderBy = "size_desc" %>

Example (ColdFusion):
<CFSET Obj.OrderBy = "size_desc">
Password POP3 account password, required for authentication.

Example (ASP):
<% Obj.Password = "mypassword" %>

Example (ColdFusion):
<CFSET Obj.Password = "mypassword">
Port This property is used to specify POP3 server port. If not specefied then default port 110 is used.

Example (ASP):
<% Obj.Port = 8110 %>

Example (ColdFusion):
<CFSET Obj.Port = 8110>
ServerName This property is used to specify POP3 server name or IP address.

Example (ASP):
<% Obj.ServerName = "aspfusion.net" %>

Example (ColdFusion):
<CFSET Obj.ServerName = "aspfusion.net">
SortFirst 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

Example (ASP):
<% Obj.SortFirst = true %>

Example (ColdFusion):
<CFSET Obj.SortFirst = true>
Timeout This property is used to set request timeout value. If not specified then default timeout value 60 is used.

Example (ASP):
<% Obj.Timeout = 120 %>

Example (ColdFusion):
<CFSET Obj.Timeout = 120>
Type This property is used to set content type for the file to be downloaded through Download or DownloadAs methods. Default value is "application/octet-stream".

Example (ASP):
<% Obj.Type = "application/zip" %>

NOTE: Can only be used for ASP.
UserName POP3 account user name, required for authentication.

Example (ASP):
<% Obj.UserName = "myusername" %>

Example (ColdFusion):
<CFSET Obj.UserName = "myusername">

AdvPOP3 Methods

Method Parameter Return Value Description
Delete None None Delete specified message(s) from the mailbox using their message sequence numbers.

Example (ASP):
<% Obj.Delete() %>

Example (ColdFusion):
<CFSET Obj.Delete()>
Download 1. Source File None Download the given source file to client's browser.

Example (ASP):
<% Obj.Download("c:\myfolder\myfile.exe") %>

NOTE: Can only be used for ASP.
DownloadAs 1. Source File
2. New File Name
None Download the given source file with given name to client's browser.

Example (ASP):
<% Obj.Download("c:\myfolder\myfile.exe", "yourfile.exe") %>

NOTE: Can only be used for ASP.
GetAll None Array of objects Retrieve the data associated with message(s) using message sequence numbers.

Example (ASP):
<% set Result = Obj.GetAll()
for each Member in Result
        Response.Write Member.MessageNo
        Response.Write Member.Priority
        Response.Write Member.Date
        Response.Write Member.MessageID
        Response.Write Member.MIMEVersion
        Response.Write Member.ContentType
        Response.Write Member.From
        Response.Write Member.To
        Response.Write Member.ReplyTo
        Response.Write Member.Subject
        Response.Write Member.XMailer
        Response.Write Member.UID
        Response.Write Member.Status
        Response.Write Member.Size
        Response.Write Member.CC
        Response.Write Member.Body
        Response.Write Member.HTMLBody
        Response.Write Member.AttachmentSent
        Response.Write Member.AttachmentSaved
        Response.Write Member.AttachmentFiles
        set List = Member.ExtraHeaders()
        for each Mem in List
               Response.Write Mem.Name
               Response.Write Mem.Value
        next
        set List = nothing
next
set Result = nothing %>

Example (ColdFusion):
<CFSET Result = Obj.GetAll()>
<CFLOOP Collection="#Result#" Item="Member">
        <CFOUTPUT>
               #Member.MessageNo#
               #Member.Priority#
               #Member.Date#
               #Member.MessageID#
               #Member.MIMEVersion#
               #Member.ContentType#
               #Member.From#
               #Member.To#
               #Member.ReplyTo#
               #Member.Subject#
               #Member.XMailer#
               #Member.UID#
               #Member.Status#
               #Member.Size#
               #Member.CC#
               #Member.Body#
               #Member.HTMLBody#
               #Member.AttachmentSent#
               #Member.AttachmentSaved#
               #Member.AttachmentFiles#
               <CFSET List = Member.ExtraHeaders()>
               <CFLOOP Collection="#List#" Item="Mem">
                      <CFOUTPUT>
                             #Mem.Name#
                             #Mem.Value#
                      </CFOUTPUT>
               </CFLOOP>
        </CFOUTPUT>
</CFLOOP>

WHERE in GetAll collection
MessageNo contains message sequence number of the message.
Priority contains priority number of the message.
Date contains mail date.
MessageID contains message id.
MIMEVersion contains valid version for the MIME.
ContentType contains content type, means what type of message it is.
From contains mail address of the sender of the mail.
To contains receiver address(s).
ReplyTo contains reply address.
Subject contains subject of the mail.
XMailer contains value for X-Mailer header.
UID contains UID for the mail.
Status contains value of the current status of the mail.
Size contains size of mail.
CC contains CC address(s).
Body contains body of the mail.
HTMLBody contains HTML body of the mail, if mail is sent in HTML format.
AttachmentSent contains a tab-separated list of all source attachment names.
AttachmentSaved contains 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, AdvPOP3 component will change it to a unique file name before saving it.
AttachmentFiles contains 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.

WHERE in ExtraHeaders collection
Name contains name of the header.
Value contains value of the header.

GetHeaderOnly None Array of objects Retrieve the headers data associated with message(s) using message sequence numbers.

Example (ASP):
<% set Result = Obj.GetHeaderOnly()
for each Member in Result
        Response.Write Member.MessageNo
        Response.Write Member.Priority
        Response.Write Member.Date
        Response.Write Member.MessageID
        Response.Write Member.MIMEVersion
        Response.Write Member.ContentType
        Response.Write Member.From
        Response.Write Member.To
        Response.Write Member.ReplyTo
        Response.Write Member.Subject
        Response.Write Member.XMailer
        Response.Write Member.UID
        Response.Write Member.Status
        Response.Write Member.Size
        Response.Write Member.CC
        set List = Member.ExtraHeaders()
        for each Mem in List
               Response.Write Mem.Name
               Response.Write Mem.Value
        next
        set List = nothing
next
set Result = nothing %>

Example (ColdFusion):
<CFSET Result = Obj.GetHeaderOnly()>
<CFLOOP Collection="#Result#" Item="Member">
        <CFOUTPUT>
               #Member.MessageNo#
               #Member.Priority#
               #Member.Date#
               #Member.MessageID#
               #Member.MIMEVersion#
               #Member.ContentType#
               #Member.From#
               #Member.To#
               #Member.ReplyTo#
               #Member.Subject#
               #Member.XMailer#
               #Member.UID#
               #Member.Status#
               #Member.Size#
               #Member.CC#
               <CFSET List = Member.ExtraHeaders()>
               <CFLOOP Collection="#List#" Item="Mem">
                      <CFOUTPUT>
                             #Mem.Name#
                             #Mem.Value#
                      </CFOUTPUT>
               </CFLOOP>
        </CFOUTPUT>
</CFLOOP>

WHERE in GetHeaderOnly collection
MessageNo contains message sequence number of the message.
Priority contains priority number of the message.
Date contains mail date.
MessageID contains message id.
MIMEVersion contains valid version for the MIME.
ContentType contains content type, means what type of message it is.
From contains mail address of the sender of the mail.
To contains receiver address(s).
ReplyTo contains reply address.
Subject contains subject of the mail.
XMailer contains value for X-Mailer header.
UID contains UID for the mail.
Status contains value of the current status of the mail.
Size contains size of mail.
CC contains CC address(s).

WHERE in ExtraHeaders collection
Name contains name of the header.
Value contains value of the header.

Status None Object Requests the current status of mailbox.

Example (ASP):
<% set Result = Obj.Status()
        Response.Write Result.Count
        Response.Write Result.Size
set Result = nothing %>

Example (ColdFusion):
<CFSET Result = Obj.Status()>
<CFOUTPUT>
        #Result.Count#
        #Result.Size#
</CFOUTPUT>

WHERE in Status object
Count contains total number of messages in mailbox.
Size contains total size of the mailbox.