Unable to send an email using SMTP (Getting javax.mail.MessagingException: Could not convert socket to TLS;)

前端 未结 11 1907
北恋
北恋 2020-12-10 12:04

I have written the following code for sending email using javamail API through SMTP as TLS as SSL is not supported but I ended up with the following exception. Please see my

11条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-10 12:31

    I resolved this issue by just commenting the below property

    props.put("mail.smtp.starttls.enable", "true"); 
    

    and the code got executed with no errors or warning or simply delete this line from the above source code. It is working like a charm till date.

提交回复
热议问题