Fixed a fun bug where the mail body got stuck in the header.
This commit is contained in:
parent
e7b0925a64
commit
af769100e7
1 changed files with 10 additions and 7 deletions
|
@ -85,6 +85,8 @@ fn main() {
|
|||
match rx.recv() {
|
||||
Ok(data) => {
|
||||
println!("Sending mail to: {}", data[0]);
|
||||
let title = format!("You were mentioned in {} on {}", data[2], data[1]);
|
||||
let body = format!("{} wrote: {}", data[3], data[4]).into_bytes();
|
||||
let mail = lettre::SendableEmail::new(
|
||||
lettre::Envelope::new(
|
||||
Some(
|
||||
|
@ -94,9 +96,10 @@ fn main() {
|
|||
vec![
|
||||
lettre::EmailAddress::new(data[0].clone()).unwrap()]
|
||||
).unwrap(),
|
||||
format!("You were mentioned in {} on {}", data[2], data[1]),
|
||||
format!("{}: {}", data[3], data[4]).into_bytes()
|
||||
title,
|
||||
body
|
||||
);
|
||||
|
||||
match mailer.send(mail) {
|
||||
Ok(_) => println!("Email sent successfully!"),
|
||||
Err(e) => panic!("Could not send email: {:?}", e),
|
||||
|
|
Loading…
Reference in a new issue