Skip to content

SMTP

Send emails via SMTP protocol using raw TCP sockets (RFC 5321).

Install

bash
wyn pkg install github.com/wynlang/smtp

Usage

wyn
var ok = Smtp.send(
    "smtp.example.com",  // host
    25,                   // port
    "from@example.com",  // from
    "to@example.com",    // to
    "Hello",             // subject
    "Message body"       // body
)
if ok {
    println("Email sent")
}

API

MethodDescription
Smtp.send(host, port, from, to, subject, body) -> boolSend email via SMTP

Supports plain SMTP (port 25/587). For TLS/STARTTLS, use a relay that supports unencrypted connections.

MIT License