Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
Rust send smtp email by Zoho code example
// === In Cargo.toml file======
// lettre = "0.9.2"
// lettre_email = "0.9.2"
// native-tls = "0.2.3"
// ============================
use lettre_email::Email;
use lettre::smtp::authentication::Credentials;
use lettre::{ClientSecurity, ClientTlsParameters, SmtpClient, Transport};
use native_tls::TlsConnector;
fn main() {
let creds = Credentials::new(
let mail = Email::builder()
.body("Body Content")
let connector = TlsConnector::new().unwrap();
let tls_params = ClientTlsParameters::new("".to_string(), connector);
let security = ClientSecurity::Wrapper(tls_params);
let mut mailer = SmtpClient::new("", security)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment