JavaMail SMTPSendFailedException

ⅰ亾dé卋堺 提交于 2019-12-06 11:17:09

OK I figured out where I was going wrong here and am posting up the answer incase anybody else can get some value out of it. I had the following line of code:

props.put("mail.smtp.auth", true);

This was telling my application that it needed to authenticate to the SMTP server, when in fact it didnt. This was causing my application from logging into the SMTP server and sending the email and thus producing the error message. Setting this property to false or not having this line of code fixed the issue for me. This line of code is only necessary for SMTP servers that require you to login, which my Exchange server didnt.

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!