server: add content-type header to the email

This commit is contained in:
Valentin Tolmer 2023-02-14 11:13:10 +01:00 committed by nitnelave
parent 62104b417a
commit 672dd96e7e

View File

@ -21,7 +21,11 @@ async fn send_email(to: Mailbox, subject: &str, body: String, options: &MailOpti
.reply_to(reply_to) .reply_to(reply_to)
.to(to) .to(to)
.subject(subject) .subject(subject)
.body(body)?; .singlepart(
lettre::message::SinglePart::builder()
.header(lettre::message::header::ContentType::TEXT_PLAIN)
.body(body),
)?;
let creds = Credentials::new( let creds = Credentials::new(
options.user.clone(), options.user.clone(),
options.password.unsecure().to_string(), options.password.unsecure().to_string(),