[][src]Module lettre::transport::smtp::client

SMTP client

SmtpConnection allows manually sending SMTP commands.

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

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

Structs

ClientCodec

The codec used for transparency

MockStream
SmtpConnection

Structure that implements the SMTP client

TlsParameters

Parameters to use for secure clients

Enums

Tls

How to apply TLS to a client connection