If you feel some confusion about any thing or if you do not find what you are looking for, please inform us so that we can improve our documentation accordingly. docs@aspfusion.net

AdvPOP3

The component allows you to perform retrieve and delete mail messages from any standard POP3 server, which compiles with RFC 1939, via a web page and offer functionality that POP3 server support. Access to the component can also be turned on at website basis like all other ASPFusion components. The component exposes message headers via properties and handles quoted-printable and base64 decoding file attachments and embedded images also. It provides following operations.

  1. Retrieve mail messages using message numbers and also can sort the messages in ascending and descending given criteria.

  2. Delete mail messages.

  3. Check current status, as number of mail messages present and total size.

  4. It also provides Download and DownloadAs for handling mail attachments. Download operation allows downloading file to client browser with actual file name and DownloadAs operation allows downloading file to client browser with specified name.

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

AdvPOP3 Properties 

Property

Description

AttachmentPath

The physical path where attachments will be saved
Example:
<%Obj.AttachmentPath = “C:\Temp”%>

AttachmentPathError

Returns 1 if any error occur in AttachmentPath otherwise 0
Example:
<%if Obj.AttachmentPathError = 1 then
        Error in Attachment Path and attachments could not be
saved
end if %>

AttachmentPathErrorReason

Reports any error that occur due to AttchmentPath
Example:
<%if Obj.AttachmentPathError = 1 then
        Response.Write Obj. AttachmentPathErrorReason
end if %>

AttachmentPathHTTP

URL for the AttachmentPath where attachments are saved
Example:
<%Obj.AttachmentPathHTTP = “http://localhost/temp”%>

DeleteFile If this property is TRUE then file is deleted from server after downloading. Valid values are
FALSE (default)
TRUE
Example:

<%Obj.DeleteFile
= true%>  
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:

<%Obj.DownloadedUIDs
= “2,5,8,12,17”%>  
DownloadForceFully If this property is TRUE then file is downloaded forcefully. Valid values are
FALSE (default)
TRUE
Example:

<%Obj.DownloadForceFully
= true%>  

ErrorReason

Reports any errors that occur during the request
Example:
<%if Obj.IsError = 1 then
        Response.Write Obj.ErrorReason
else
        No Error
end if %>

IsError

Returns 1 if any error occur during the request otherwise 0
Example:
<%if Obj.IsError = 1 then
        Error

else
        No Error
end if
%>

MessageNumber

Required for Delete, GetHeaderOnly(optional, default is all message numbers) and GetAll(optional, default is all message numbers). 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:
<%Obj.MessageNumber = “2,5,8,12,17”%>

OrderBy

Required for GetHeaderOnly(optional), GetAll(optional). Required 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(without attachment mails first) Attachment_DESC(with attachment mails first)
Example:
<%Obj.OrderBy = “Size_DESC”%>

Password

Required for connection to server in all methods
Example:
<%Obj.Password = "Testing"%>

Port

Optional. If not specified then default port 110 is used  

Example:
<%Obj.Port = 842%>

ServerName

Required. Host name or IP address of the POP3 server  
Example:
<%Obj.ServerName = “LocalHost”%>

SortFirst Required for GetHeaderOnly(optional), required 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 then the component will fetch all messages first and will sort on given sorting criteria and then will return mail messages that come in sequence from 1 to 5, and if this parameter is set as FALSE then the component will fetch messages from 1 to 5 and will sort on given sorting criteria and then will return mail messages. Valid sorting criteria are
TRUE
FALSE (default)
Example:
<%Obj.SortFirst = true%>
Type This property is used to set content type for the file to be downloaded. Default value is application/octet-stream.
Example:

<%Obj.Type
= ”application/zip”%>  

UserName

Required for connection to server in all method 
Example:
<%Obj.UserName = “David”%>

AdvPOP3 Methods

Method

Parameter

Return Value

Description

Delete

None

None

Delete specified message(s) from the mailbox using their sequence numbers
Example:
<%Obj.Delete()%>

Download

Source

None

Download the source file to client’s browser
Example:
<%Obj.Download(Source)%>

DownloadAs

Source
FileName

None

Download the source file with given name to client’s browser
Example:
<%Obj.DownloadAs Source, FileName%>

GetAll

None

Array of Objects

Retrieves the data associated with messages using message sequence numbers
Example:
<%set Result = Obj.GetAll()
for each Member in Result
      =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
      set list = Member.ExtraHeaders()
      for each val in list
            =val.Name&" = "&val.Value
      next
      set list = nothing
next
set Result = nothing%>

GetHeaderOnly

None

Array of objects

Retrieves the headers data associated with messages using message sequence numbers
Example:
<%set Result = Obj.GetHeaderOnly()
for each Member in Result
      =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
      set list = Member.ExtraHeaders()
      for each val in list
            =val.Name&" = "&val.Value
      next
      set list = nothing
next
set Result = nothing%>

Status

None

Object

Requests the current status
Example:
<%set Result = Obj.Status()

  
=Result.Count
   =Result.Size
set Result = nothing%>

Back

Copyright © 2000, Advanced Communications