diff --git a/src/lib.rs b/src/lib.rs index cea6196..a66a6a3 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -53,6 +53,7 @@ async fn message_handler(message: String) -> Result<()> { let message = MessageParser::default().parse(&message).unwrap(); let message_body = message.body_text(0).unwrap(); + let message_subject = message.subject().unwrap(); let message_sender = message.from().unwrap().as_list().unwrap()[0] .address() .unwrap(); @@ -61,7 +62,7 @@ async fn message_handler(message: String) -> Result<()> { return Ok(()); } - let message = format!("New mail from {message_sender}:\n{message_body}"); + let message = format!("New mail from {message_sender} with subject {}:\n{}", message_subject.trim(), message_body.trim()); send_message(&message).await?; Ok(())