smtpSetConfig (Function) |
Top Previous Next |
This function will set the configuration for the SMTP interface. The SMTP configuration is stored in persistent memory and only needs to be set once.
Using secure connection For NX32L devices a secure TLS (TLS v1.2, v1.1 or 1.0) connection can be established assuming that a matching X509 root certificate is present.
To use secure connection: 1. Ensure the root certificate needed to verify the mail server is present. 2. Set 'useTLS := TRUE' when calling smtpSetConfig.
Input: IP : STRING The IP address of the mail server (max. 40 characters).
Port : DINT (default 25) The port of the mail server.
iface : SINT (default 0) The network interface to use. 0 = Default network, 1 = Mobile network, 2 = LAN network, etc. (See Network) Note: For backwards compatibility the Mobile network is used as default network.
Sender : STRING The mail address of the sender. (max. 40 characters).
Authenticate : BOOL
Username : STRING The user name the device should use in order to connect to the mail server (max. 40 characters).
Password : STRING The password the device should use in order to connect to the mail server (max. 40 characters).
UseTLS : BOOT (default FALSE)
Returns: INT
Declaration: FUNCTION smtpSetConfig : INT;
Example: INCLUDE rtcu.inc |