SMTP Email Helpers
smtp_send(config) → (success, error)
Send an email via SMTP and wait for confirmation (10s timeout).
Config table fields:
server(string, required) - SMTP server hostnameport(number, optional) - SMTP port (default based on TLS mode: starttls→587, tls→465, none→25)tls(string, optional) -"starttls"(default),"tls", or"none"username(string, optional) - SMTP usernamepassword(string, optional) - SMTP passwordfrom(string, required) - Sender email addressto(string or array, required) - Recipient email address(es)subject(string, required) - Email subjecttext(string, optional) - Plain text bodyhtml(string, optional) - HTML body
At least one of text or html must be provided. Returns: success (boolean), error (string|nil).
smtp_send_async(config) → boolean
Fire-and-forget variant (10s timeout in background). Same config as smtp_send. Returns true if queued, false if
validation failed.