POP3 Object
Overview
Retrieves mail from any POP3 server. The object retrieves and stores sets of messages in the Message property. Downloaded messages are available through the Mail Message Object.
Sections
Init, Main, Procedures, OnExit, and Structure.
note
The object is declared in the Declare section.
Properties
Name | Description |
---|---|
State | The state of the POP3 Object |
Timeout | Timeout in milliseconds. |
ServerMsgCount | Number of unread messages at the server. |
LocalMsgCount | Number of downloaded messages. |
Message | Returns a message that is already downloaded. |
ObjectIsEmpty | Returns 1 if object is not created. |
LastReturnCode | Returns last known return code from object. |
note
Properties ObjectIsEmpty
and LastReturnCode
are common methods. For more information see Common properties and methods.
Methods
Name | Description |
Login | Establishes a session using basic authentication. |
LoginWithClientSecret | Establishes a session using modern authentication with a client secret. |
LoginWithCertificate | Establishes a session using modern authentication with a certificate. |
SetCertificate | Points to the certificate used for authentication when using modern authentication. |
Logout | Ends a session. |
DownloadMessages | Downloads messages from server. |
DeleteMessages | Marks messages to delete on server. |
CreateObject | Creates a new instance of the object. |
FreeObject | Releases the instance of the object. |
note
Methods CreateObject
and FreeObject
are common methods. For more information see Common properties and methods.
See Also
SMTP Object
Mail Message Object
Properties
State
State of the POP3 Object.
Type: MailStateConstants
Default: -
Read: get_State
Write: -
See Also
MailStateConstants
POP3 Object::Login
POP3 Object::Logout
Timeout
Timeout in milliseconds.
Default value: 30000
Type: Integer
Default: -
Read: get_Timeout
Write: put_Timeout
ServerMsgCount
Number of unread messages at the server. Automatically filled after a successful login.
Type: Integer
Default: -
Read: get_ServerMsgCount
Write: -
See Also
LocalMsgCount
Number of downloaded messages. Use this property for a maximum value of the LocalIndex parameter in the Message property.
Type: Integer
Default: -
Read: get_LocalMsgCount
Write: -
See Also
Message
Returns a message that is already downloaded. Index is 1 to POP3 Object::LocalMsgCount. Use this property to get hold of the downloaded messages.
Type: Integer
Default: -
Read: get_Message
Write: -
See Also
Mail Message Object
POP3 Object::LocalMsgCount
POP3 Object::DownloadMessages
Methods
Login
Establishes a session. Server parameter may be either a host name or a dot address. Returns True_Value (1) on success.
Implicit SSL will be used unless StartTLSOption specifies Always
or Retry
(implicit SSL will be used in first handshake attempt though).
Most POP servers require a username and password, so you should specify both. After a successful login the ServerMsgCount property is set to the number of messages on the server.
Parameters
Server | Type: String Description: Can be either:
For more information, see Well-known mail servers. |
Port | Type: Integer Default: 110 Description: Specifies the port number. Defaults to the "well-known" port 110. |
Username | Type: String Default: ' Description: Specifies the server account to access. |
Password | Type: ParamTypePassword Default: ' Description: Specifies the password for the server account. |
StartTlsOption | Type: MailStartTlsOptions Default: Retry Description: Specifies how Start TLS will be used. Possible values are:
|
SSLVersions | Type: SSLVersions Default: TLS 1.3, TLS 1.2 Description: Specifies which SSL/TLS version(s) that may be used. For more information, see General information about SSL and TLS. |
ReturnValue | Type: ParamTypeBool Description: Returns True_Value (1) on success. |
See Also
POP3 Object::Logout
POP3 Object::State
POP3 Object::ServerMsgCount
LoginWithClientSecret
Establishes a session using modern authentication with a client secret instead of basic authentication.
Returns True_Value (1) on success.
note
Currently, this method can only be used with Microsoft Office 365. The Server
parameter needs to be set to Auto:Modern-MicrosoftOffice365
.
For more information, see Authentication in mail clients using Microsoft Office 365.
Parameters
Server | Type: String Default: Auto:Modern-MicrosoftOffice365 Description: Specifies the Server used for authentication. Currently, it can only be set to Auto:Modern-MicrosoftOffice365 . |
Tenant Id | Type: String Default: ' Description: Specifies the Tenant Id of the Azure Active Directory. |
Client Id | Type: String Default: ' Description: Specifies the identifier for the Azure AD client (application) used for authentication. |
Client secret | Type: String Default: ' Description: Specifies the application secret used to authenticate the client. |
Account name | Type: String Default: ' Description: Specifies the account name of the user. |
ReturnValue | Type: ParamTypeBool Description: Returns True_Value (1) on success. |
See Also
POP3 Object::LoginWithCertificate
POP3 Object::Logout
LoginWithCertificate
Establishes a session using modern authentication with a certificate instead of basic authentication.
Returns True_Value (1) on success.
note
Currently, this method can only be used with Microsoft Office 365. The Server
parameter needs to be set to Auto:Modern-MicrosoftOffice365
.
For more information, see Authentication in mail clients using Microsoft Office 365.
Parameters
Server | Type: String Default: Auto:Modern-MicrosoftOffice365 Description: Specifies the Server used for authentication. Currently, it can only be set to Auto:Modern-MicrosoftOffice365 . |
Tenant Id | Type: String Default: ' Description: Specifies the Tenant Id of the Azure Active Directory. |
Client Id | Type: String Default: ' Description: Specifies the identifier for the Azure AD client (application) used for authentication. |
Account name | Type: String Default: ' Description: Specifies the account name of the user. |
ReturnValue | Type: ParamTypeBool Description: Returns True_Value (1) on success. |
See Also
POP3 Object::SetCertificate
POP3 Object::LoginWithClientSecret
POP3 Object::Logout
SetCertificate
Points to the certificate used for authentication when using modern authentication.
Use CertificateStoreName
and StoreLocation
to point out store and use IssuedBy
and SerialNumber
to point out the certificate in the selected store.
Parameters
CertificateStoreName | Type: CryptStoreNameType Description: Name of certificate store. Example: "MY" |
StoreLocation | Type: StoreLocationValueType Description: Location of store. |
IssuedBy | Type: String Description: Certificate issuer. |
SerialNumber | Type: String Description: Serial number of the certificate. |
See Also
POP3 Object::LoginWithCertificate
Logout
Ends a session.
Successful execution of this method permanently removes any "marked-for-delete" messages from the server, ends the session, and causes the server to terminate the connection. Failure to use this method causes the server to clear any pending "marked-for-delete" message flags.
note
The property MsgNumber is set to 0 for all downloaded messages when logged out.
Parameters
---
See Also
POP3 Object::Login
POP3 Object::State
POP3 Object::DeleteMessages
DownloadMessages
Downloads messages from server.
The method makes it easy to download any or all parts of a set of messages. The destination for messages is the Messages property.
Messages are not automatically deleted by default when they are downloaded. You must delete messages explicitly by using the DeleteMessages method.
Parameters
Part | Type: MailGetPartConstants Default: MailGetAll Description: Specifies the message part or attribute to be retrieved. |
MsgSet | Type: String Description: If MsgSet="" all messages are fetched. To specify messages to fetch, use message indexes (from 1 to ServerMsgCount). Example: "1, 5:7, 12" |
See Also
MailGetPartConstants
POP3 Object::DeleteMessages
POP3 Object::LocalMsgCount
DeleteMessages
Marks messages to delete on server.
Messages specified in the parameter MsgSet are "marked" for deletion. The message are removed when the session is gracefully ended using Logout. If Logout is not used, for example if the system goes down unintentionally, the messages marked for deletion are "de-marked" and will not be deleted.
Parameters
MsgSet | Type: String Description: If MsgSet="" all messages are deleted. To specify messages to delete, use message indexes (from 1 to ServerMsgCount). Example: "1, 5:7, 12" |