TPop3Cli Last Updated: 09/29/2001 |
TPop3Cli class implements the POP3 protocol (RFC-1225, RFC-1939) used to retrieve mail form a mail server.
This component, combined with the TSmtpCli component form the basis of an e-mail client.
Here are the sections available for the TPop3Cli:
- [ Properties ]
- [ Events ]
- [ Methods ]
- [ Notes ]
Below is the full description for all the sections in the TPop3Cli:
Below is a list of all Properties for use as a quick reference:
Below is a list of all Properties with their complete descriptions:
Connected: | property Connected: Boolean; Specifies if there is currently an active connection to the POP3 server. |
[Return to Top] | |
ErrorMessage: | property ErrorMessage: String; Contains the string of the last error that occurred. |
[Return to Top] | |
Host: | property Host: String; The POP3 Server to which you want to connect. |
[Return to Top] | |
LastResponse: | property LastResponse: String; The server response from the most recent command request. |
[Return to Top] | |
LocalAddr: | property LocalAddr: String; Can be a dotted IP address, or a hostname. Preferable is a dotted IP address. For a client it is the machine to connect to, and for a server it is the interface to listen on if it is a multihomed computer. Default value for a server is '0.0.0.0'. |
[Return to Top] | |
MsgCount: | property MsgCount: Integer; Updated by the Stat() method with the number of messages in the maildrop. |
[Return to Top] | |
MsgLines: | property MsgLines: Integer; This is the number of lines to display when the Top() method is issued. Set to zero to display only the message headers. The line can be read from the LastResponse property. |
[Return to Top] | |
MsgNum: | property MsgNum: Integer; This is the number of the message on which you will operate. It is also updated by the Last() method. |
[Return to Top] | |
MsgSize: | property MsgSize: Integer; Updated by the Stat() and Last() methods with the total size of the messages in the maildrop. It is also updated with the size in bytes of a singe message by certain methods. |
[Return to Top] | |
MsgUidl: | property MsgUidl: String; Contains the Unique Identifier Listing (UIDL) number for the current message. It is updated by the Uidl() method. |
[Return to Top] | |
PassWord: | property PassWord: String; The password used to authenticate with the POP3 server. |
[Return to Top] | |
Port: | property Port: String; The tcp port of the POP3 server to which you want to connect. |
[Return to Top] | |
ProtocolState: | property ProtocolState: TPop3ProtocolState; The current state of the POP3 transaction. It can be any of the following: pop3Disconnected, pop3WaitingUser, pop3WaitingPass, pop3Transaction |
[Return to Top] | |
State: | property State: TPop3State; The current state of the component. It can be any of the following: pop3Ready, pop3DnsLookup, pop3Connecting, pop3Connected, pop3InternalReady, pop3WaitingBanner, pop3WaitingResponse, pop3Abort. |
[Return to Top] | |
UserName: | property UserName: String; The username used to authenticate with the POP3 server. |
[Return to Top] | |
Below is a list of all Events for use as a quick reference:
Below is a list of all Events with their complete descriptions:
OnDisplay: | property OnDisplay: TPop3Display; This event is fired whenever a command is sent or a response is received. This is mainly used to trace or log the POP3 transaction with the server while debugging. |
[Return to Top] | |
OnListBegin: | property OnListBegin: TNotifyEvent; When the List() method is called with MsgNum zero, this event is fired to mark the beginning of the list processing. |
[Return to Top] | |
OnListEnd: | property OnListEnd: TNotifyEvent; When the List() method is called with MsgNum zero, this event is fired when the list has been processed completely. |
[Return to Top] | |
OnListLine: | property OnListLine: TNotifyEvent; When the List() method is called with MsgNum zero, this event is fired for each line retrieved from the list. The line can be read from the LastResponse property. |
[Return to Top] | |
OnMessageBegin: | property OnMessageBegin: TNotifyEvent; This event is fired when a message is about to be retrieved after a Retr() or Top() method has been called. |
[Return to Top] | |
OnMessageEnd: | property OnMessageEnd: TNotifyEvent; This event is fired when a message has been retrieved completely after a Retr() or Top() method call. In the case of the Top() method, OnMessageEnd is fired after the lines specified in the MsgLines property have been retrieved. |
[Return to Top] | |
OnMessageLine: | property OnMessageLine: TNotifyEvent; This event is fired for each line retrieved after a Retr() or Top() method call. The line can be read from the LastResponse property. |
[Return to Top] | |
OnRequestDone: | property OnRequestDone: TPop3RequestDone; This event is fired after a request to the POP3 server has finished and a response has been received, even if the request failed. |
[Return to Top] | |
OnResponse: | property OnResponse: TPop3Display; This event is fired every time a response is received from the POP3 server as a consequence to a POP3 command. |
[Return to Top] | |
OnSessionClosed: | property OnSessionClosed: TSessionClosed; This event is fired when the POP3 session is closed and the connection to the server is dropped due to a Quit() or Abort() method call. |
[Return to Top] | |
OnSessionConnected: | property OnSessionConnected: TSessionConnected; This event is fired when a connection to the POP3 server is established and the POP3 session starts after a Connect() or Open() method call (when the welcome banner is received). In the case of the Open() method, OnSessionConnected is fired after the connection is established but before the USER and PASS commands are sent. |
[Return to Top] | |
OnStateChange: | property OnStateChange: TNotifyEvent; This event is fired whenever the state of the POP3 session is changed. |
[Return to Top] | |
OnUidlBegin: | property OnUidlBegin: TNotifyEvent; When the Uidl() method is called with MsgNum zero, this event is fired to mark the beginning of the list processing. |
[Return to Top] | |
OnUidlEnd: | property OnUidlEnd: TNotifyEvent; When the Uidl() method is called with MsgNum zero, this event is fired when the list has been processed completely. |
[Return to Top] | |
OnUidlLine: | property OnUidlLine: TNotifyEvent; When the Uidl() method is called with MsgNum zero, this event is fired for each line retrieved from the list. The line can be read from the LastResponse property. |
[Return to Top] | |
Below is a list of all Methods for use as a quick reference:
Below is a list of all Methods with their complete descriptions:
Abort: | procedure Abort; Aborts the current operation and closes the connection. This is a quick and dirty way of closing a POP3 session. |
[Return to Top] | |
APop: | procedure APop; Attempts server authentication using encrypted password. If the POP3 server supports this method, it is more secure to use it than the User() Pass() methods that send the password in plaintext. |
[Return to Top] | |
ClearErrorMessage: | procedure ClearErrorMessage; Clears the ErrorMessage property. |
[Return to Top] | |
Connect: | procedure Connect; Connects to the POP3 server and starts the POP3 session. |
[Return to Top] | |
Dele: | procedure Dele; Marks a message for deletion. The message to be deleted is read from the MsgNum property. Note: Messages marked for deletion are not deleted right away. They are deleted when the Quit() method is issued and the session is closed. This allows messages to be undeleted using the RSet() method. |
[Return to Top] | |
HighLevelAsync: | procedure HighLevelAsync(RqType: TPop3Request; Fcts: TPop3FctSet); Provides a high level interface to execute a set of POP3 commands in sequence asynchronously. This is the way the Open() command is implemented. |
[Return to Top] | |
Last: | procedure Last; Updates the MsgNum and MsgSize properties with the number and size of the last message retrieved, respectively. |
[Return to Top] | |
List: | procedure List; Retrieves a list with message information from the server. If the MsgNum property is zero, all messages are listed and the MsgNum and MsgSize properties are updated for every message read. The OnListLine event is fired after each message is read. If the MsgNum property is greater than zero, then the MsgSize property is updated with the size of that message in bytes. |
[Return to Top] | |
Noop: | procedure Noop; The 'No Operation' command. This command is used to avoid disconnection due to an idle timeout. Most servers ignore this command so it is pretty much useless. |
[Return to Top] | |
Open: | procedure Open; The combination of the Connect(), User(), and Pass() methods sent asynchronously in sequence. This method is an example implementation of the HighLevelAsync() method. |
[Return to Top] | |
Pass: | procedure Pass; Sends the Password (in plaintext) for authentication. |
[Return to Top] | |
Quit: | procedure Quit; Closes the POP3 session and disconnects from the server. At this point, the server removes any messages marked for deletion by the Dele() method. |
[Return to Top] | |
Retr: | procedure Retr; Retrieves a message from the server. The message to be retrieved is read from the MsgNum property. |
[Return to Top] | |
RPop: | procedure RPop; The RPop() method does the same as the Pass() method to authenticate access to the maildrop except that the POP3 server considers if the remote user specified by the RPop() method is allowed to access the maildrop for the user specified by the User() method. |
[Return to Top] | |
RSet: | procedure RSet; Resets the POP3 session and clears all messages marked for deletion. |
[Return to Top] | |
Stat: | procedure Stat; Updates the MsgCount and MsgSize properties with the total number of messages and the total byte size of the maildrop, respectively. |
[Return to Top] | |
Top: | procedure Top; Retrieves only part of a message. The message to be retrieved is taken from the MsgNum property and the amount of lines is taken from the MsgLines properties. The lines are counted from the top of the message, after the headers, and the headers are always included. If MsgLines is zero, then only the headers of the message are retrieved. The OnMessageLine event is fired after each line that is retrieved. |
[Return to Top] | |
Uidl: | procedure Uidl; Retrieves a list of UIDLs from the server. If the MsgNum property is zero, all messages are listed and the MsgNum and MsgUidl properties are updated for every message read. The OnUidlLine event is fired after each message is read. If the MsgNum property is greater than zero, then the MsgUidl property is updated with the Unique ID Listing of that message. |
[Return to Top] | |
User: | procedure User; Sends the Username for authentication. |
[Return to Top] | |
Below is a list of all Notes for use as a quick reference:
Below is a list of all Notes with their complete descriptions:
Asynchronous: | TPop3Cli is an asynchronous component. It is non-blocking and event-driven. This means that when you request an operation such as connect, the component starts the operation your requested and gives control back immediately while performing the operation in the background automatically. |
[Return to Top] | |