The built-in functions in the POP3Session class provide the ability to connect to a POP3 server with a variety of methods and retrieve email and send POP3 commands.
The POP3Session class offers the following functionality:
POP3Session New() port parameters
ListMessages() Constants
POP3Session New( String host, [Integer port] )
Returns a new POP3Session object
host | - | IP address or domain name of POP3 host. |
port | - | POP3 connection port, optional and defaults to 110 |
Integer Close()
No parameters. Closes the session.
None |
Integer DeleteMessage( Dynamic messageIndex )
The messageIndex parameter can be either an Integer ID or a String UID. Marks the specified message for deletion on the server.
messageIndex | - | either an Integer ID or a String UID of the message to retrieve |
String GetLastError( )
No parameters. Returns an error string for the last error that occured.
Integer GetTimeout()
Gets the timeout value for POP3 commands. The timeout is in milliseconds.
None |
String GetUID( Integer messageIndex )
Returns the UID for the given message. If no message exists, returns and empty string.
messageIndex | - | ID of the message to retrieve |
Integer InitContext( SSLOptions options )
Sets the SSL options for a secure connection. You must call this before attempting to do a SecureLogin() call.
options | - | an instance of SSLOptions. |
Integer ListMessage( Dynamic messageIndex )
The messageIndex parameter can be either an Integer ID or a String UID. Returns the size of the message specified by mesgIndex or -1 if any errors occurred.
messageIndex | - | either an Integer ID or a String UID of the message to retrieve |
List ListMessages( [Integer listType] )
If listType is not specified or LIST_BY_IDS, then it returns a List of the message ids and sizes, one after the other. Ie, 1,234,2,3435,3,5430. If listType is LIST_BY_UIDS, then it returns a List of the message ids and their UID strings, one after the other, ie, 1,34DF32EAC3,2,64EA32EDC3,3,354456CAE3.
listType | - | type of list to return, either LIST_BY_IDS, or LIST_BY_UIDS. |
Boolean Login( String username, String password )
The client will check server capabilities and authenticate using CRAM-MD5 if available automatically, otherwise, it will login with CLEAR.
username | - | username used to login to POP3 server. |
password | - | password used to login to POP3 server. |
Integer MessageCount()
No parameters. Returns the number of messages for the logged in user on the POP3 server.
List RetrieveHeader( Dynamic messageIndex )
The messageIndex parameter can be either an Integer ID or a String UID. Returns a List composed of the key/value string pairs found in the header of the given message. The return value will be Undefined if no message exists at that index. Ie, key1, value1, key2, value2, etc.
messageIndex | - | either an Integer ID or a String UID of the message to retrieve |
MailMessage RetrieveMessage( Dynamic messageIndex )
The messageIndex parameter can be either an Integer ID or a String UID. Returns a MailMessage class for the given messageIndex. The return value will be Undefined if no message exists at that index.
messageIndex | - | either an Integer ID or a String UID of the message to retrieve |
Integer SecureLogin( String username, String password )
Does an SSL secure login. You must have called InitContext() before this.
username | - | user login on POP3 server |
password | - | user password for POP3 server |
Integer SendCommand( String command, [String arguments] )
Use this to send other raw POP3 commands. The arguments param is optional.
command | - | command to send |
arguments | - | command arguments to send |
Boolean ServerHasUIDs()
Returns TRUE if the server supports UIDL command, FALSE otherwise
None |
Integer SetTimeout( Integer timeout )
Sets the timeout value for POP3 commands. The timeout is in milliseconds.
timeout | - | timeout in milliseconds. |