jakarta mail - SMTP error code : 551



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应用程序集成时,我得到了上面的错误

发送成功,如果我使用相同的属性在单独的类与主和运行作为java应用程序

为什么我没有得到这个?

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");`