SMTP错误代码:551

rvd

com.sun.mail.smtp.SMTPSendFailedException: 551 This mail server requires authentication before sending mail from a locally hosted domain. Please reconfigure your mail client to authenticate before sending mail.

与运行在Tomcat服务器上的Java应用程序集成时,出现上述错误

如果我在main的单独类中使用相同的属性并作为Java应用程序运行,则发送成功

为什么我没有得到这个?先感谢您。

rvd
Finally got answer
Here we go: before it was like
`Properties props = new Properties();
props.put("mail.smtp.host", "webmail.technobbyte.com");
props.put("mail.smtp.port", "25");
props.put("mail.smtp.starttls.enable", true);
props.put("mail.smtp.auth", true);`


now i changed to:
`Properties props = new Properties();
props.setProperty("mail.smtp.host", "webmail.technobbyte.com");
props.setProperty("mail.smtp.port", "25");
props.setProperty("mail.smtp.starttls.enable", "true");
props.setProperty("mail.smtp.auth", "true");`

本文收集自互联网,转载请注明来源。

如有侵权,请联系 [email protected] 删除。

编辑于
0

我来说两句

0 条评论
登录 后参与评论

相关文章