[Minor] Added logger to send mail with attachment

This commit is contained in:
Robert von Burg 2023-08-03 16:52:59 +02:00
parent 2ae0389f2c
commit e197a3eb6b
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
1 changed files with 2 additions and 0 deletions

View File

@ -149,6 +149,8 @@ public class SmtpMailer {
message.setContent(multipart);
Transport.send(message);
logger.info(format("Sent E-mail with subject {0} to {1} and attachment {2}", subject,
addressesToString(recipientAddresses), fileName));
} catch (MessagingException e) {
logger.error("Failed to send the following e-mail:\nSubject: " + subject + "\nAttachment: " + fileName +
"\nRecipients: " + recipients + "\n\nBody:\n" + text);