OstroSoft - Home of Internet Tools

OstroSoft POP3 Component (OSPOP3.dll)

Session
MessageList
MessageListEntry
Message
Recipients
Email
Attachments
Attachment
Headers
Header
Values
Component object model

Description

A software library for retrieving email messages from POP3 mailserver.

Works with programming and scripting languages supporting .NET or COM

Supports secure email(SSL), complete and partial message retrieval, email (MIME) attachments, mailbox status check and reset

Installation

1. download OSPOP3.zip

2. unzip downloaded file to a temporary directory

3. copy OSPOP3_Plus.dll to a root directory of your .NET project

* if you are using the component from VB6 or other COM language copy both OSPOP3_Plus.dll and OSPOP3_Plus.tlb to a system directory, then register OSPOP3_Plus.tlb

License typePrice

Non-commercial license free
Unlimited usage for developing non-commercial applications.

Developer license $19.00(purchase)
For a single programmer to develop and distribute a single commercial application.

Server license $59.00(purchase)
For use in a commercial application, installed on a single server.

Enterprise license $139.00(purchase)
For programmers within a company to develop and distribute an unlimited number of commercial applications.

Object reference
Session object
Top object in component hierarchy: maintains connection to the mailserver, retrieves mailbox statistics and list of messages, retrieves and deletes messages
Methods:
object.Base64Decode(ByVal s As String) As String
Decode Base64-encoded string
object.ClosePOP3()
Close POP3 session, disconnect from the server
object.DeleteMessage(MessageId As Long) As Boolean
Delete specified message from the server
object.GetMailboxSize() As Long
Get total size of the messages in mailbox, in octets (bytes)
object.GetMessageCount() As Long
Get number of messages in mailbox
object.GetMessage(MessageId As Long, [RemoveFromServer As Boolean = False]) As Message
Retrieve specified (by message ID) message from the server, optionally delete it after retrieval
object.GetMessageHeaders(MessageId As Long, [NumberOfLines As Long]) As Message
Get email headers for specified message, optionally retrieve specified number of lines from the top of the message body
object.GetMessageList() As Collection
Retrieve list of available messages (collection of MessageListEntry objects)
object.OpenPOP3([ServerName As String], [PortNumber As Long], [Login As String], [Password As String]) As Boolean
Connect to server, authenticate and establish POP3 session
object.QuotedPrintableDecode(ByVal s As String) As String
Decode quoted-printable string
object.ResetSession() As Boolean
Reset POP3 session (restore messages, deleted during current session)
Events:
object_Closed()
POP3 session closed
object_Connected()
Connected (and authenticated) to POP3 server
object_ErrorPOP3(Number As Long, Description As String)
Error occured
object_StateChanged(SESSION_STATE As StateConstants)
Connection state changed
object_StatusChanged(Status As String, StatusType As StatusTypeConstants)
Status property changed
Properties:
object.Login As String
User login (username) for authenticating to mailserver
object.MailboxSize As Long
Total size of the messages in mailbox, in octets (bytes) (read-only)
object.MessageCount As Long
Number of messages in mailbox (read-only)
object.MessageList As Collection
List of messages (collection of MessageListEntry objects) in mailbox
object.Password As String
User password for authenticating to mailserver
object.PortNumber As Long
POP3 server port number (by default - 110)
object.RaiseError As Boolean
Defines the component behavior when error occurs. When set to True, raises an error, otherwise - fires ErrorPOP3 event
object.SelectedMessage As Message
Last message, retrieved by GetMessage or GetMessageHeaders methods
object.ServerName As String
POP3 server name or IP address
object.State As StateConstants (Long)
State of POP3 session. The following session state constants are defined:
valuenamedescription
0popClosedconnection closed
1popResolvingHostresolving mailserver name
2popHostResolvedmailserver name successfully resolved
3popConnectingconnecting to mailserver
4popConnectedconnected to mailserver
5popAuthenticatingauthenticating to mailserver
6popAuthenticatedsuccessfully authenticated to mailserver
7popClosingconnection is closing
8popErrorerror occured
object.Status As String
Last status of POP3 component, returned by StatusChanged event
object.StatusOption As StatusOptionConstants (Long)
Instructs POP3 Component what status changes to report. The following status option constants are defined:
valuenamedescription
0soNonedo not report any status changes
1soPOP3Requestsreport POP3 Requests
2soPOP3Responsesreport POP3 Responses
4soStatesreport POP3 session states
8soErrorreport errors
15soAllreport everything
You can also use OR expressions.
For example: (soPOP3Requests OR soPOP3Responses) will report both POP3 Requests and Responses
object.StatusType As StatusTypeConstants
Type of the last status, returned by StatusChanged event. The following status option constants are defined:
valuenamedescription
1stPOP3RequestsPOP3 Request
2stPOP3ResponsesPOP3 Response
4stStatesPOP3 session state
8stErrorError
object.Timeout As Long
Connection timeout in milliseconds (default - 10000)
object.UseSSL As Boolean
When set to true, uses POP3 over secure connection (TLS/SSL)

MessageListEntry object
Item in MessageList collection of Session
Properties:
object.ID As Long
Message ID
object.Size As Long
Message size in octets (bytes)
object.UIDL As String
Message UIDL (if supported by server) - unique identifier assigned to message by mailserver

Message object
Returned by GetMessage or GetMessageHeaders functions, contains parsed email message
Methods:
object.Save(FILE_NAME As String)
Save message to a specified location
Properties:
object.All As String
Entire message (including headers, all body parts and attachments) in original (.eml) format
object.Attachments As Collection
Collection of message attachments (Attachment objects)
object.Body As String
Message body
object.Charset As String
Message charset
object.ContentTransferEncoding As String
Message content-transfer-encoding
object.ContentType As String
Message content type
object.DateSent As String
Message timestamp
object.Headers As Collection
Collection of message headers (Header objects)
object.HTMLBody As String
HTML part of message body
object.Recipients As Collection
Collection of message recipients (Email objects)
object.RecipientsCC As Collection
Collection of message CC recipients (Email objects)
object.Sender As Email
Message sender
object.Subject As String
Message subject
object.UIDL As String
Message UIDL (if supported by server)

Header object
Item in Headers collection of Message
Properties:
object.Name As String
Header name
object.Values As Collection
Collection of string values, associated with header

Email object
Pair of name and email address assigned to message sender and recipients
Properties:
object.Address As String
Email address
object.Name As String
Name, assigned to email address (optional)

Attachment object
Item in Attachments collection of Message
Methods:
object.Save(FILE_NAME As String)
Saves attachment to a specified location. If attachment is Base64 encoded, it will be decoded before saving
Properties:
object.AttachmentName As String
Attachment name
object.Body As String
Attachment body
object.ContentDisposition As String
Content disposition header of attachment
object.ContentTransferEncoding As String
Type of attachment encoding
object.ContentType As String
MIME type of attachment
object.Filename As String
Attachment filename