javax.mail.MessagingException: 553 authentication is required,smtp1,ClUQrEBZRUJX0rRPvSYiAg--.48266S2 1337250391
at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:1020)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:716)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:388)
at com.oarage.easystation.sendmail.MailSendClass.send(MailSendClass.java:143)
at com.sun.mail.smtp.SMTPTransport.issueCommand(SMTPTransport.java:1020)
at com.sun.mail.smtp.SMTPTransport.mailFrom(SMTPTransport.java:716)
at com.sun.mail.smtp.SMTPTransport.sendMessage(SMTPTransport.java:388)
at com.oarage.easystation.sendmail.MailSendClass.send(MailSendClass.java:143)
at com.oarage.easystation.sendmail.MailSendClass.main(MailSendClass.java:153)
找了好久,最后发现了错误的原因。
我写成了这样的,props.put("mail.smtp.auth", true);//设置smtp身份认证
实际应该是这props.put("mail.smtp.auth", “true”);//设置smtp身份认证,而且"mail.smtp.auth"不要有空格(切记)
是不是晕死啊!为什么好让我犯这种错误,找半天,才发现自己就是一个废物!
本文详细记录了在使用JavaMail发送邮件过程中遇到的553 authentication is required异常及解决过程。问题在于配置文件中关于SMTP身份验证的设置不正确,通过调整属性设置解决了该问题。
2816

被折叠的 条评论
为什么被折叠?



