Module lettre::transport::smtp::client

source ·
Available on crate feature smtp-transport only.
Expand description

SMTP client

SmtpConnection allows manually sending SMTP commands.


use lettre::transport::smtp::{
    client::SmtpConnection, commands::*, extension::ClientId, SMTP_PORT,
};

let hello = ClientId::Domain("my_hostname".to_owned());
let mut client = SmtpConnection::connect(&("localhost", SMTP_PORT), None, &hello, None, None)?;
client.command(Mail::new(Some("user@example.com".parse()?), vec![]))?;
client.command(Rcpt::new("user@example.org".parse()?, vec![]))?;
client.command(Data)?;
client.message("Test email".as_bytes())?;
client.command(Quit)?;

Structs§

Enums§

Traits§