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

后端 未结 2 408
被撕碎了的回忆
被撕碎了的回忆 2021-01-22 03:08

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:36

    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");
    
    0 讨论(0)
  • 2021-01-22 03:50

    Add:

    <prop key="mail.debug">true</prop>
    <prop key="mail.smtps.localhost">'localhost'</prop>
    
    0 讨论(0)
提交回复
热议问题