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§
- A certificate that can be used with
TlsParametersBuilder::add_root_certificate
- An identity that can be used with
TlsParametersBuilder::identify_with
- Structure that implements the SMTP client
- Parameters to use for secure clients
- Builder for
TlsParameters
Enums§
- Source for the base set of root certificates to trust.
- Specifies how to establish a TLS connection
- TLS protocol versions.