aboutsummaryrefslogtreecommitdiff
path: root/juick-api/src/main
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2017-12-25 12:03:31 +0300
committerGravatar Vitaly Takmazov2017-12-25 12:03:31 +0300
commite8ffd4497af18b22519c94f1b22c32ddf3d446f0 (patch)
tree588f76212d0ed1efd77eccf5b8dc1a9f53458365 /juick-api/src/main
parent152bc963bfebe36dcf6370457813321a70687353 (diff)
trying to enable STARTTLS
Diffstat (limited to 'juick-api/src/main')
-rw-r--r--juick-api/src/main/java/com/juick/api/EmailManager.java6
1 files changed, 5 insertions, 1 deletions
diff --git a/juick-api/src/main/java/com/juick/api/EmailManager.java b/juick-api/src/main/java/com/juick/api/EmailManager.java
index eca2dfa3..edf7c000 100644
--- a/juick-api/src/main/java/com/juick/api/EmailManager.java
+++ b/juick-api/src/main/java/com/juick/api/EmailManager.java
@@ -17,6 +17,8 @@ import javax.mail.Transport;
import javax.mail.internet.InternetAddress;
import javax.mail.internet.MimeMessage;
+import java.util.Properties;
+
import static com.juick.formatters.PlainTextFormatter.formatPost;
import static com.juick.formatters.PlainTextFormatter.formatUrl;
@@ -42,7 +44,9 @@ public class EmailManager implements ApplicationListener<MessageEvent> {
}
void emailNotify(String email, Message msg) {
- Session session = Session.getDefaultInstance(System.getProperties());
+ Properties prop = System.getProperties();
+ prop.put("mail.smtp.starttls.enable", "true");
+ Session session = Session.getDefaultInstance(prop);
try {
MimeMessage message = new MimeMessage(session);
message.setFrom(new InternetAddress("juick@juick.com"));