From 2c26ab95def2dd2b51fde5d293eed55835751656 Mon Sep 17 00:00:00 2001 From: Thelie Date: Sun, 23 May 2021 22:44:24 +0200 Subject: [PATCH] Made mail subjects work properly. --- src/main.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6f7ce39..729b0d8 100644 --- a/src/main.rs +++ b/src/main.rs @@ -85,8 +85,9 @@ 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 id = "notarealiid@mention2mail".to_owned(); + let body = format!("Subject: You were mentioned in {} on {}\n{} wrote: {}", + data[2], data[1], data[3], data[4]).into_bytes(); let mail = lettre::SendableEmail::new( lettre::Envelope::new( Some( @@ -96,7 +97,7 @@ fn main() { vec![ lettre::EmailAddress::new(data[0].clone()).unwrap()] ).unwrap(), - title, + id, body );