SMTP_SERVER
A struct type with the connection to a server that sends mail, like the one of your mail provider.
Declare it with VARIABLE smtp STRUCT c0de_net/mail/SMTP_SERVER and set its elements with ASSIGN. server and from are needed, the other elements start with defaults that fit most providers.
serverSTRING: the server name, like smtp.example.comportINTEGER: 1 to 65535, or 0 for 465 withtlsand 587 otherwise (default 0)securitySTRING:starttls(the default for an empty text),tlsfor a connection that is encrypted from the start, ornoneuserSTRING: the user name, empty to send without logging inpasswordSTRING: the passwordfromSTRING: the address of the sender, likeBase computer <steve@example.com>timeoutINTEGER: seconds a call may take, or 0 for the default of the server (30 seconds, which is also the largest value)skip_ssl_validationBOOLEAN: true to accept any certificate, e.g. of a server in your home network (default false)
Port 25 is blocked unless the server allows it. Use the submission port of your mail provider, 465 or 587.
The element password has the tag security: "sensitive", so the debugging tool shows *** instead of it. Like for HTTP_CONNECTION, don't write it into the program: pass it in as a parameter, or read it from the vault of c0de.
Example
c0de
PROGRAM postman
NOOP
INCLUDE c0de_net/mail
NOOP
FUNCTION run
PARAMETER password STRING
BEGIN
VARIABLE smtp STRUCT c0de_net/mail/SMTP_SERVER
ASSIGN smtp.server "smtp.example.com" ;
ASSIGN smtp.user "steve@example.com" ;
ASSIGN smtp.password password ;
ASSIGN smtp.from "Base computer <steve@example.com>" ;
END FUNCTION