Skip to content

Commit

Permalink
using .starttls_relay() instead of .relay() as it doesnt work wiht mo…
Browse files Browse the repository at this point in the history
…st SMTP services
  • Loading branch information
amitu committed Feb 21, 2024
1 parent fb991e0 commit 70199d7
Showing 1 changed file with 4 additions and 7 deletions.
11 changes: 4 additions & 7 deletions fastn-core/src/mail.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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::<lettre::Tokio1Executor>::relay(&self.smtp_host)?
.credentials(creds)
.build();
let mailer =
lettre::AsyncSmtpTransport::<lettre::Tokio1Executor>::starttls_relay(&self.smtp_host)?
.credentials(creds)
.build();

println!("mailer created");

Expand Down

0 comments on commit 70199d7

Please sign in to comment.