Mail module

Mail_Server

structSource

The SMTP server mail_send talks to, and how it logs in.

host is a name or address and port is the TCP port; 0 uses the SMTP default (25). With enable_ssl the connection must be upgraded to TLS (STARTTLS) before anything else is sent, and the send fails when the server cannot; without it the whole exchange, credentials included, travels in clear text. ssl_ca_bundle_path names a file of trusted certificates, or is empty for libcurl's default. Login is attempted when username or password is set. Strings are borrowed for the call and never freed. verbose_logging makes libcurl print the protocol exchange to standard error. timeout_milliseconds limits the whole send, connecting and the transfer included, and mail_send fails when it runs out; 0 (the default) sets no limit. There is no option for a connection that starts as TLS (the smtps port 465 style): only STARTTLS is offered, which is what ports 25 and 587 use.

Fields

host: string
port: int
enable_ssl: bool
ssl_ca_bundle_path: string
username: string
password: string
verbose_logging: := false
timeout_milliseconds: := 0

See also