Method SMTPClient():setConnectionSecurity() Professional

Configures secure communication with the server.

Syntax
:setConnectionSecurity( <cSecurity> ) --> lSuccess
Parameters
<cSecurity>
The parameter <cSecurity> is a character string which determines how secure communication occurs between the SMTP server and the client. Valid security specifiers are "tls", "starttls" and "none".
Return

The return value is .T. (true) if the connection security can be configured and .F. (false) in case of an error.

Description

With the method :setConnectionSecurity(), an encrypted connection to the SMTP server can be requested. This requires an SSL negotiation to be performed after connecting, which can be achieved in several ways. With the "tls" method, SSL negotiation occurs right after the connection to the server. With "starttls", the negotiation occurs after an initial SMTP handshake which is human readable and hence less secure. If the string "none" is assigned to the <cSecurity> parameter, SSL is not used and all communication is unencrypted.

By default, the connection security is determined by the port specified when calling the method :new(). This default can be overridden with the method :setConnectionSecurity(), for example, for using SSL with non-standard ports.

Feedback

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.