Dec 18

If you get the following error and not sure how to fix it then read on.

Caused by: javax.mail.MessagingException: 501 Syntax: HELO hostname
at com.sun.mail.smtp.SMTPTransport.issueCommand(
at com.sun.mail.smtp.SMTPTransport.helo(
at com.sun.mail.smtp.SMTPTransport.protocolConnect(
at javax.mail.Service.connect(

This is typically caused by the system property “mail.smtp.localhost” not being set by your Java VM. This should be already set for you automatically if your runtime environment is configured properly.

From the javadoc:

Local host name used in the SMTP HELO or EHLO command. Defaults to InetAddress.getLocalHost().getHostName(). Should not normally need to be set if your JDK and your name service are configured properly.

Hope this helps.

written by objects \\ tags: , , , , ,

Leave a Reply

You must be logged in to post a comment.