OstroSoft - Home of Internet Tools
OstroSoft POP3 Component (OSPOP3.dll)

OSPOP3.dll is a COM library for Visual Basic 6, providing functionality to retrieve emails from mailserver (POP3).
By using OSPOP3.dll you agree to terms of License Agreement

for use with Visual Basic 6 (any edition):
1)download POP3_component.zip
2)unzip OSPOP3.dll from it to Windows System directory
3)run "regsvr32 OSPOP3.dll" from command-line

for use with .NET, Visual Basic 4 or 5, Visual C++, ASP, VBA, VBScript, JavaScript or any other language, supporting COM:
1)download POP3_component.exe
2)run downloaded file from Windows Explorer or command-line


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.ClosePOP3()
closes POP3 session, disconnects from the server
object.DeleteMessage(MessageId As Long)
deletes specified message from the server
object.GetMailboxSize() As Long
returns mailbox size in octets (bytes)
object.GetMessage(MessageId As Long, [RemoveFromServer As Boolean = False]) As Message
retrieves specified (by message ID) message from the server, optionally deletes it after retrieval
object.GetMessageCount() As Long
returns number of messages in mailbox
object.GetMessageHeaders(MessageId As Long, [NumberOfLines As Long]) As Message
retrieves headers for specified message, optionally retrieves specified number of lines from the top of the message body
object.GetMessageList() As Collection
returns the list of available messages - collection of MessageListEntry objects
object.OpenPOP3([ServerName As String], [PortNumber As Long], [Login As String], [Password As String])
connects to server, authenticates and establishes POP3 session
object.ResetSession()
resets current session to original state, undeletes all messages, deleted during current session
Properties:
object.Login
returns/sets session login (username) for authenticating to mailserver
object.MailboxSize
returns mailbox size in octets (bytes), retrieved by GetMailboxSize or GetMessageCount command
object.MessageCount
returns number of messages in mailbox, retrieved by GetMailboxSize or GetMessageCount command
object.MessageList
returns collection of MessageListEntry objects, retrieved by GetMessageList command
object.Password
sets password for authenticating to mailserver
object.PortNumber
returns/sets mailserver port number (by default - 110)
object.ServerName
returns/sets server name or IP address
object.State
returns session state. 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

MessageListEntry object
object in MessageList collection of Session

Properties:
object.ID
returns message ID
object.Size
returns message size in octets (bytes)
object.UIDL
returns message UIDL (if supported by mailserver) - unique identifier assigned to message by mailserver

Message object
returned by GetMessage and GetMessageHeaders functions, contains parsed email message

Methods:
object.Save(FILE_NAME As String)
saves message to a specified location
Properties:
object.All
returns entire message in original (.eml) format
object.Attachments
collection of message attachments (Attachment objects)
object.Body
returns message body
object.Charset
returns message charset
object.ContentType
returns message content type
object.DateSent
returns message timestamp
object.Headers
collection of message headers (Header objects)
object.HTMLBody
returns HTML part of message body
object.Recipients
collection of message recipients (Email objects)
object.Sender
returns message sender (Email object)
object.Subject
returns message subject
object.UIDL
returns message UIDL (if supported by mailserver)

Header object
member of Headers collection, populated by GetMessage or GetMessageHeaders functions

Properties:
object.Name
returns header name
object.Values
collection of string values, associated with header

Email object
pair of name and email address assigned to message sender and recipients

Properties:
object.Address
returns email address
object.Name
returns name (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
returns attachment name
object.Body
returns attachment body
object.ContentDisposition
returns content disposition header of attachment
object.ContentTransferEncoding
returns type of attachment encoding
object.ContentType
returns MIME type of attachment
object.Filename
returns the original filename