|
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.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.GetMessageCount() As Long Get number of messages in mailbox |
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:
value | name | description |
0 | popClosed | connection closed |
1 | popResolvingHost | resolving mailserver name |
2 | popHostResolved | mailserver name successfully resolved |
3 | popConnecting | connecting to mailserver |
4 | popConnected | connected to mailserver |
5 | popAuthenticating | authenticating to mailserver |
6 | popAuthenticated | successfully authenticated to mailserver |
7 | popClosing | connection is closing |
8 | popError | error 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:
value | name | description |
0 | soNone | do not report any status changes |
1 | soPOP3Requests | report POP3 Requests |
2 | soPOP3Responses | report POP3 Responses |
4 | soStates | report POP3 session states |
8 | soError | report errors |
15 | soAll | report 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:
value | name | description |
1 | stPOP3Requests | POP3 Request |
2 | stPOP3Responses | POP3 Response |
4 | stStates | POP3 session state |
8 | stError | Error |
|
object.Timeout As Long Connection timeout in milliseconds (default - 10000) |
|
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.UIDLMessage 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 |