Method SMTPClient():new() Professional
Creates an instance of the SMTPClient class.
:new( <cSmtpServer> , ;
[<nPort>] , ;
[<cFromHost>] , ;
[<oLogWriter>], ;
[<nLogLevel>] ) --> oSMTPClient
Port Number: | Description |
---|---|
25 *) | SMTP standard port. Communication is unencrypted. |
465 | Encrypted SSL connection (SMTPS), can only be used with SMTP servers which support SSL. |
587 | Encrypted Transport Layer Security (TLS) connection which is "upgraded" to using SSL encryption, if supported. Can be used with both SSL and non-SSL SMTP servers. |
|
<nLogLevel> | Description |
---|---|
0 | Only errors are reported. |
1 | Errors and warnings are reported. |
2 | All communication with the mail server is reported. |
The method returns an instance of the SMTPClient class.
The method :new() creates a new SMTPClient object. The parameters passed when calling :new() define basic parameters for operations performed later by the SMTP client object.
The <nPort> parameter has special meaning in terms of how communication occurs between the SMTP server and the client. By default, unencrypted communication is used via the SMTP standard port 25. However, if port 465 is specified via the <nPort> parameter, the client implicitly performs an SSL negotiation right after connecting to the server. This is also known as SMTPS or TLS. If port 587 is used, the client performs an initial SMTP (human readable) handshake before starting SSL negotiation. In the context of SMTP this is known as STARTTLS.
If the server waits on non-standard ports for incoming connections then the method :setConnectionSecurity() can be used to force the type of communication.
Consult the information supplied by your e-mail provider to find out what type of connection is supported by the e-mail server.
If you see anything in the documentation that is not correct, does not match your experience with the particular feature or requires further clarification, please use this form to report a documentation issue.