aboutsummaryrefslogtreecommitdiff
path: root/src/org/traccar/notification/NotificationMail.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/org/traccar/notification/NotificationMail.java')
-rw-r--r--src/org/traccar/notification/NotificationMail.java10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/org/traccar/notification/NotificationMail.java b/src/org/traccar/notification/NotificationMail.java
index 17e4d6be4..7b7ef6e74 100644
--- a/src/org/traccar/notification/NotificationMail.java
+++ b/src/org/traccar/notification/NotificationMail.java
@@ -61,6 +61,11 @@ public final class NotificationMail {
properties.put("mail.smtp.ssl.trust", sslTrust);
}
+ String sslProtocols = provider.getString("mail.smtp.ssl.protocols");
+ if (sslProtocols != null) {
+ properties.put("mail.smtp.ssl.protocols", sslProtocols);
+ }
+
properties.put("mail.smtp.auth", provider.getString("mail.smtp.auth"));
String username = provider.getString("mail.smtp.username");
@@ -101,8 +106,9 @@ public final class NotificationMail {
}
message.addRecipient(Message.RecipientType.TO, new InternetAddress(user.getEmail()));
- message.setSubject(NotificationFormatter.formatTitle(userId, event, position));
- message.setText(NotificationFormatter.formatMessage(userId, event, position));
+ MailMessage mailMessage = NotificationFormatter.formatMessage(userId, event, position);
+ message.setSubject(mailMessage.getSubject());
+ message.setContent(mailMessage.getBody(), "text/html; charset=utf-8");
Transport transport = session.getTransport();
try {