ignore empty lines in debug_emails.txt

This commit is contained in:
nobody 2024-08-06 22:26:06 +02:00 committed by murmeldin
parent 8cf25de458
commit 29e6285e3c

View file

@ -66,7 +66,7 @@ pub struct SimpleEmail {
impl SimpleEmail {
pub fn new(base: Email, from: &str, to: &str, in_reply_to: Option<String>) -> Self {
let recipients = to.split('\n').map(|s| s.to_string()).collect();
let recipients = to.split('\n').map(|s| s.trim().to_string()).filter(|s| !s.is_empty()).collect();
Self { base: base.clone(), from: from.to_string(), to: recipients, in_reply_to }
}
pub fn send_email(&self, subject: String, body: String) -> Result<String, Box<dyn Error>> {