OScript API/Built-in Package Index |
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:
List messages by IDs
List messages by UIDs
Login with username and password
Login with OAuth2 token
The standard POP3 port, 110
The standard Secure POP3 port, 995
Returns a new POP3Session instance, or undefined if an error occured.
Returns a new POP3Session instance using a SSL socket, or undefined if an error occured.
Close a connection to an POP3 server.
deletes a message from the POP3 server.
Retrieve the a string for the last error code.
Retrieves a table of message IDs from the POP3 server.
Returns the POP3 timeout in milliseconds.
retrieves a UID for a message on the POP3 server.
Used to initialize a security context for SecureLogin().
retrieves the size of a message from the POP3 server.
retrieves a list of messages from the POP3 server.
Initiate a connection to an POP3 server.
returns the number of messages for the logged in account.
retrieves a message header from the POP3 server.
retrieves a message header from the POP3 server.
retrieves a message from the POP3 server.
Initiate a secure connection to an POP3 server.
Sends raw POP3 commands.
Determines if the server supports the UIDL command.
Set POP3 timeout in milliseconds.
List messages by IDs
List messages by UIDs
Login with username and password
Login with OAuth2 token
The standard POP3 port, 110
The standard Secure POP3 port, 995
Returns a new POP3Session object
IP address or domain name of POP3 host.
POP3 connection port, optional and defaults to 110
A new POP3Session object or undefined if there was an error constructing the object.
Returns a new POP3Session object using a SSL socket.
IP address or domain name of POP3 host.
POP3 connection port, optional and defaults to 110
SSL options
A new POP3Session object using a SSL socket or undefined if there was an error constructing the object.
No parameters. Closes the session.
Returns 0 for success and -1 if an error occurred.
The messageIndex parameter can be either an Integer ID or a String UID. Marks the specified message for deletion on the server.
either an Integer ID or a String UID of the message to retrieve
Returns 0 if successful, -1 if any errors occurred.
No parameters. Returns an error string for the last error that occured.
Returns an error string for the last error that occured.
If listType is not specified or LIST_BY_IDS, then it returns a RecArray of message IDs and sizes. If listType is LIST_BY_UIDS, then it returns a RecArray of the message ids and their UID strings, one after the other.
type of list to return, either LIST_BY_IDS, or LIST_BY_UIDS.
Returns a table of ids.
Gets the timeout value for POP3 commands. The timeout is in milliseconds.
Returns the timeout in milliseconds, -1 if an error occured.
Returns the UID for the given message. If no message exists, returns and empty string.
ID of the message to retrieve
Returns the UID for the given message. If no message exists, returns and empty string.
Sets the SSL options for a secure connection. You must call this before attempting to do a SecureLogin() call.
an instance of SSLOptions.
Returns 0 for success and -1 if an error occurred.
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.
either an Integer ID or a String UID of the message to retrieve
Returns the size of the message specified by mesgIndex or -1 if any errors occurred.
If listType is not specified or LIST_BY_IDS, then it returns a List of the message ids and sizes, one after the other. i.e. {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, i.e., {1,34DF32EAC3,2,64EA32EDC3,3,354456CAE3}.
The return value will be Undefined if the server returned an error.
type of list to return, either LIST_BY_IDS, or LIST_BY_UIDS.
Returns a list of ids.
The client will check server capabilities and authenticate using CRAM-MD5 if available automatically, otherwise, it will login with CLEAR.
username used to login to POP3 server.
user password or authentication token for POP3 server.
type of login authentication to use: either POP3Session.LOGIN_PLAIN or POP3Session.LOGIN_XOAUTH2.
Returns 1 for success and 0 if an error occurred.
No parameters. Returns the number of messages for the logged in user on the POP3 server.
Returns the number of messages for the logged in user on the POP3 server.
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. i.e. key1, value1, key2, value2, etc.
either an Integer ID or a String UID of the message to retrieve
Returns a List for the given messageIndex. The return value will be Undefined if no message exists at that index.
The messageIndex parameter can be either an Integer ID or a String UID.
Returns an Assoc 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.
either an Integer ID or a String UID of the message to retrieve
Returns an Assoc for the given messageIndex. The return value will be Undefined if no message exists at that index.
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.
either an Integer ID or a String UID of the message to retrieve
Returns a MailMessage class for the given mesgIndex. The return value will be Undefined if no message exists at that index.
Does an SSL secure login. You must have called InitContext() before this.
user login on POP3 server.
user password or authentication token for POP3 server.
type of login authentication to use: either LOGIN_PLAIN or LOGIN_XOAUTH2.
Returns 0 for success and -1 if an error occurred.
Use this to send other raw POP3 commands. The arguments param is optional.
command to send
command arguments to send
Returns 0 for success and -1 if an error occurred.
Determines if the server supports the UIDL command that is used to list messages by UID.
TRUE if the server supports the UIDL command, FALSE otherwise. If support cannot be determined, then the return value will be Undefined.
Sets the timeout value for POP3 commands. The timeout is in milliseconds.
timeout in milliseconds.
Returns 0 for success and -1 if an error occurred.
Copyright © 2023 OpenText Corporation. All rights reserved. |