Skip to Main Content

Java EE (Java Enterprise Edition) General Discussion

Announcement

For appeals, questions and feedback about Oracle Forums, please email oracle-forums-moderators_us@oracle.com. Technical questions should be asked in the appropriate category. Thank you!

Setting 'mail.smtp.localhost' to make things work

843830Jan 30 2004 — edited Jan 31 2004
Hello

I was getting this error with my initial attempts to send myself an email using JavaMail:

javax.mail.MessagingException: 501 Syntactically invalid HELO argument(s)

After hunting around for a while I came across references to doing this:

props.put( "mail.smtp.localhost", "localhost" )

So I tried it, and it works!

I'm happy about that, but I would like to find out why? I just cannot seem to find an answer anywhere.

I run Windows XP, and my hosts file has not been changed - localhost is still there, as shipped. When I call this:

InetAddress.getLocalHost().getHostName()

I get the $COMPUTERNAME value for my PC which happenes to be "HARRY_PC".

My real concern is what will happen when I deploy my application to other machines - is this little 'hack' likely to break things?

Hmm...

Many thanks!

Harry Mantheakis
London, UK
Comments
Locked Post
New comments cannot be posted to this locked post.
Post Details
Locked on Feb 28 2004
Added on Jan 30 2004
2 comments
629 views