Java F.A.Q

  1. แก้ปัญหา Send mail error

java.lang.RuntimeException: javax.mail.MessagingException: Could not convert socket to TLS;
nested exception is:
javax.net.ssl.SSLHandshakeException: No appropriate protocol (protocol is disabled or cipher suites are inappropriate)
at com.zti.dld.email.SendMailUtils.send(SendMailUtils.java:146)

เพิ่ม properties
props.put("mail.smtp.ssl.protocols", "TLSv1.2");

Credit Big คนโสด