From 70199d79cb6fbc6a5e7708f816ea68c6f837f54a Mon Sep 17 00:00:00 2001 From: Amit Upadhyay Date: Wed, 21 Feb 2024 16:54:25 +0530 Subject: [PATCH] using .starttls_relay() instead of .relay() as it doesnt work wiht most SMTP services --- fastn-core/src/mail.rs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/fastn-core/src/mail.rs b/fastn-core/src/mail.rs index 246134781a..89d06d7564 100644 --- a/fastn-core/src/mail.rs +++ b/fastn-core/src/mail.rs @@ -66,18 +66,15 @@ impl Mailer { .header(lettre::message::header::ContentType::TEXT_HTML) .body(body)?; - println!("email: {:?}", &email); - let creds = lettre::transport::smtp::authentication::Credentials::new( self.smtp_username.clone(), self.smtp_password.clone(), ); - println!("creds created"); - - let mailer = lettre::AsyncSmtpTransport::::relay(&self.smtp_host)? - .credentials(creds) - .build(); + let mailer = + lettre::AsyncSmtpTransport::::starttls_relay(&self.smtp_host)? + .credentials(creds) + .build(); println!("mailer created");