java.lang.RuntimeException: javax.mail.MessagingException: [EOF](Caused by: javax.mail.MessagingException: [EOF])

后端 未结 2 379
半阙折子戏
半阙折子戏 2021-01-22 03:23

I am trying to write a simple mail sender with usig javax.mail

MailService:

@Service
public class MailServiceImpl implements Ma         


        
2条回答
  •  挽巷
    挽巷 (楼主)
    2021-01-22 03:53

    Add the following properties:

    properties.put("mail.smtp.starttls.enable", "true");
    properties.put("mail.smtp.port", "465");
    

    If it doesnt work, try chaning the port:

    properties.put("mail.smtp.starttls.enable", "true");
    properties.put("mail.smtp.port", "587");
    

提交回复
热议问题