Compare commits
No commits in common. "7c7163f54173bcea2e300006930ac71a3774ee0e" and "83c7b4513961919e52e4f6e748a4eb0c69ad3b94" have entirely different histories.
7c7163f541
...
83c7b45139
@ -128,37 +128,26 @@ Der Vorstand
|
|||||||
.parse()
|
.parse()
|
||||||
.unwrap());
|
.unwrap());
|
||||||
let splitted = send_to.split(',');
|
let splitted = send_to.split(',');
|
||||||
let send_mail = false;
|
|
||||||
for single_rec in splitted {
|
for single_rec in splitted {
|
||||||
match single_rec.parse() {
|
email = email.bcc(single_rec.parse().unwrap());
|
||||||
Ok(val) => {
|
|
||||||
email = email.bcc(val);
|
|
||||||
send_mail = true;
|
|
||||||
}
|
|
||||||
Err(_) => {
|
|
||||||
println!("Error in mail: {single_rec}");
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if send_mail {
|
let email = email
|
||||||
let email = email
|
.subject("ASKÖ Ruderverein Donau Linz | Vereinsgebühren")
|
||||||
.subject("ASKÖ Ruderverein Donau Linz | Vereinsgebühren")
|
.header(ContentType::TEXT_PLAIN)
|
||||||
.header(ContentType::TEXT_PLAIN)
|
.body(content)
|
||||||
.body(content)
|
.unwrap();
|
||||||
.unwrap();
|
|
||||||
|
|
||||||
let creds =
|
let creds =
|
||||||
Credentials::new("no-reply@rudernlinz.at".to_owned(), smtp_pw.clone());
|
Credentials::new("no-reply@rudernlinz.at".to_owned(), smtp_pw.clone());
|
||||||
|
|
||||||
let mailer = SmtpTransport::relay("mail.your-server.de")
|
let mailer = SmtpTransport::relay("mail.your-server.de")
|
||||||
.unwrap()
|
.unwrap()
|
||||||
.credentials(creds)
|
.credentials(creds)
|
||||||
.build();
|
.build();
|
||||||
|
|
||||||
// Send the email
|
// Send the email
|
||||||
mailer.send(&email).unwrap();
|
mailer.send(&email).unwrap();
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user