POP3 New transporter
POP3 New transporter( server : Object ) : 4D.POP3Transporter
| Parameter | Type | Description | |
|---|---|---|---|
| server | Object | → | Mail server information | 
| Function result | 4D.POP3Transporter | ← | POP3 transporter object | 
History
| Release | Changes | 
|---|---|
| 18 R2 | Added | 
Description
The POP3 New transporter command configures a new POP3 connectionaccording to the server parameter and returns a new POP3 transporter object. The returned transporter object will then usually be used to receive emails.
In the server parameter, pass an object containing the following properties:
| server | Default value (if omitted) | 
|---|---|
| .acceptUnsecureConnection : Boolean True if 4D is allowed to establish an unencrypted connection | False | 
| .accessTokenOAuth2: Text .accessTokenOAuth2: Object Text string or token object representing OAuth2 authorization credentials. Used only with OAUTH2 authenticationMode. IfaccessTokenOAuth2is used butauthenticationModeis omitted, the OAuth 2 protocol is used (if allowed by the server). Not returned in POP3 transporter object. | none | 
| .authenticationMode : Text the authentication mode used to open the session on the mail server | the most secure authentication mode supported by the server is used | 
| .connectionTimeOut : Integer the maximum wait time (in seconds) allowed to establish a connection to the server | 30 | 
| .host : Text the name or the IP address of the host server | mandatory | 
| .logFile : Text the path of the extended log file defined (if any) for the mail connection | none | 
| .password : Text User password for authentication on the server. Not returned in POP3 transporter object. | none | 
| .port : Integer the port number used for mail transactions | 995 | 
| .user : Text the user name used for authentication on the mail server | none | 
Result
The function returns a POP3 transporter object. All returned properties are read-only.
The POP3 connection is automatically closed when the transporter object is destroyed.
Example
 var $server : Object
 $server:=New object
 $server.host:="pop.gmail.com" //Mandatory
 $server.port:=995
 $server.user:="4d@gmail.com"
 $server.password:="XXXXXXXX"
 $server.logFile:="LogTest.txt" //log to save in the Logs folder
 var $transporter : 4D.POP3Transporter
 $transporter:=POP3 New transporter($server)
 $status:=$transporter.checkConnection()
 If(Not($status.success))
    ALERT("An error occurred receiving the mail: "+$status.statusText)
 End if
Properties
| Command number | 1697 | 
| Thread safe | ✓ |