[Fix] Fixed text formatting in SmtpMailer for mails with attachments

This commit is contained in:
Robert von Burg 2023-05-26 13:29:30 +02:00
parent 64cc881d9e
commit a8f60ffdc8
Signed by: eitch
GPG Key ID: 75DB9C85C74331F7
1 changed files with 2 additions and 2 deletions

View File

@ -130,13 +130,13 @@ public class SmtpMailer {
* @param recipients the addresses to whom to send the e-mail. See {@link InternetAddress#parse(String)}
*/
public void sendMail(String subject, String text, String recipients, String attachment, String fileName,
String type) {
String type) {
try {
InternetAddress[] recipientAddresses = evaluateRecipients(subject, recipients);
Message message = buildMessage(subject, recipientAddresses);
MimeBodyPart messageBodyPart = new MimeBodyPart();
messageBodyPart.setContent(text, "text/html; charset=utf-8");
messageBodyPart.setText(text);
MimeBodyPart attachmentPart = new MimeBodyPart();
attachmentPart.setContent(attachment, type);