std::net::smtpSMTP client for sending email.
Provides functions for connecting to an SMTP server and sending plain-text or HTML email messages.
import std::net::smtp;
fn main() {
let conn = smtp.connect_tls("smtp.example.com", 587, "user", "pass");
conn.send("from@example.com", "to@example.com", "Subject", "Body");
conn.close();
}
connectConnect to an SMTP server without TLS.
let conn = smtp.connect("localhost", 25, "", "");
connect_tlsConnect to an SMTP server with TLS encryption.
let conn = smtp.connect_tls("smtp.example.com", 587, "user", "pass");
ConnAn open SMTP connection handle.
Created by calling smtp.connect(...) or smtp.connect_tls(...).
Use send() or send_html() to deliver messages.
ConnMethodsMethods available on an SMTP Conn.