I\'m getting the following error when using JavaMail to send mails. Its unusual because its been working for sometime until now and no changes have been made.
5
Please try enabling transport level security
spring.mail.properties.mail.smtp.starttls.enable=true
spring.mail.properties.mail.smtp.starttls.required=true
spring.mail.properties.mail.smtp.auth=true
From JavaMail API FAQ:
Q: I get "MessagingException: 501 HELO requires domain address" when trying to send a message. A: The SMTP provider uses the results of InetAddress.getLocalHost().getHostName() in the SMTP HELO command. If that call fails to return any data, no name is sent in the HELO command. Check your JDK and name server configuration to ensure that that call returns the correct data. You may also set the "mail.smtp.localhost" property to the name you want to use for the HELO command.
It's not the exact same error message but that shouldn't make a difference for your case.
So just make sure to set it to something your mail server accepts. Check docs, config or your local postmaster as I can't tell you what that is. Probably you're just sending "localhost" which is denied. Try setting it to a hostname that actually resolves to your IP address (if possible).