POP3Transporter
The POP3Transporter
class allows you to retrieve messages from a POP3 email server.
Objeto POP3 transporter
POP3 Transporter objects are instantiated with the POP3 New transporter command. Eles oferecem as propriedades abaixo e funções:
.acceptUnsecureConnection : Boolean True if 4D is allowed to establish an unencrypted connection |
.authenticationMode : Text the authentication mode used to open the session on the mail server |
.checkConnection() : Object checks the connection using information stored in the transporter object |
.connectionTimeOut : Integer the maximum wait time (in seconds) allowed to establish a connection to the server |
.delete( msgNumber : Integer ) flags the msgNumber email for deletion from the POP3 server |
.getBoxInfo() : Object returns a boxInfo object corresponding to the mailbox designated by the POP3 transporter |
.getMail( msgNumber : Integer { ; headerOnly : Boolean } ) : Object returns the Email object corresponding to the msgNumber in the mailbox designated by the POP3 transporter |
.getMailInfo( msgNumber : Integer ) : Object returns a mailInfo object corresponding corresponding to the msgNumber in the mailbox designated by the POP3 transporter |
.getMailInfoList() : Collection returns a collection of mailInfo objects describing all messages in the mailbox designated by the POP3 transporter |
.getMIMEAsBlob( msgNumber : Integer ) : Blob returns a BLOB containing the MIME contents for the message corresponding to the msgNumber in the mailbox designated by the POP3_transporter |
.host : Text the name or the IP address of the host server |
.logFile : Text the path of the extended log file defined (if any) for the mail connection |
.port : Integer the port number used for mail transactions |
.undeleteAll() removes all delete flags set on the emails in the POP3_transporter |
.port : Integer the port number used for mail transactions |
POP3 New transporter
História
Release | Mudanças |
---|---|
18 R2 | Adicionado |
POP3 New transporter( server : Object ) : 4D.POP3Transporter
Parâmetro | Tipo | Descrição | |
---|---|---|---|
server | object | -> | Informação de servidor de correio |
Resultados | 4D.POP3Transporter | <- | POP3 transporter object |
Descrição
The POP3 New transporter
command configures a new POP3 connectionaccording to the server parameter and returns a new POP3 transporter object. O objeto transporter retornado vai geralmente ser usado para receber emails.
In the server parameter, pass an object containing the following properties:
server | Valor padrão (se omitido) |
---|---|
.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. Usado somente com OAUTH2 authenticationMode . If accessTokenOAuth2 is used but authenticationMode is omitted, the OAuth 2 protocol is used (if allowed by the server). Not returned in SMTP transporter object. | nenhum |
.authenticationMode : Text the authentication mode used to open the session on the mail server | o modo de autenticação mais seguro disponível no servidor é usado |
.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 | nenhum |
.password : Text User password for authentication on the server. Not returned in SMTP transporter object. | nenhum |
.port : Integer the port number used for mail transactions | 995 |
.port : Integer the port number used for mail transactions | nenhum |
Resultados
A função retorna um objeto POP3 transporter. Todas as propriedades retornadas são apenas leitura.
A conexão POP3 é fechada automaticamente quando o objeto transportador for destruído.
Exemplo
var $server : Object
$server:=New object
$server.host:="pop.gmail.com" //Obrigatório
$server.port:=995
$server.user:="4d@gmail.com"
$server.password:="XXXXXXXX"
$server.logFile:="LogTest.txt" //histórico para salvar na pasta Logs
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
4D.POP3Transporter.new()
4D.POP3Transporter.new( server : Object ) : 4D.POP3Transporter
Parâmetro | Tipo | Descrição | |
---|---|---|---|
server | Object | -> | Informação de servidor de correio |
Resultados | 4D.POP3Transporter | <- | POP3 transporter object |
Descrição
The 4D.POP3Transporter.new()
function creates and returns a new object of the 4D.POP3Transporter
type. It is identical to the POP3 New transporter
command (shortcut).
.acceptUnsecureConnection
História
Release | Mudanças |
---|---|
17 R4 | Adicionado |
.acceptUnsecureConnection : Boolean
Descrição
The .acceptUnsecureConnection
property contains True if 4D is allowed to establish an unencrypted connection when encrypted connection is not possible.
It contains False if unencrypted connections are unallowed, in which case an error in returned when encrypted connection is not possible.
Estão disponíveis portos seguros:
-
SMTP
- 465: SMTPS
- 587 ou 25: SMTP com atualização STARTTLS se for compat[ivel com o servidor.
-
IMAP
- 143: IMAP non-encrypted port
- 993: IMAP com atualização STARTTLS se for compatível com o servidor
-
POP3
- 110: Porta não criptografada POP3
- 995: POP3 com atualização STARTTLS se suportado pelo servidor.
.authenticationMode
História
Release | Mudanças |
---|---|
17 R4 | Adicionado |
.authenticationMode : Text