Tekst
Source
Documentation/smtpsource tree
Standard library

smtp

Native SMTP client operations for connecting to a mail server and sending messages.

Connection

connect(host, port, timeout) opens an SMTP connection. The port and timeout are optional. ehlo and helo identify the client.

Mail

mail, rcpt, and data implement message delivery steps. send sends a complete message with sender, recipient, subject, and body. login performs SMTP AUTH LOGIN. quit or close closes the connection.

TLS

starttls is not available in the current runtime and reports an explicit error.

smtp.tk
use smtp
connection = smtp.connect("127.0.0.1", 25, 30)
smtp.ehlo(connection, "localhost")
smtp.send(connection, "from@example.test", "to@example.test", "Test", "Hello")
smtp.quit(connection)