Changing the senders hostname for Java Mail
by Wolfram Saringer (2013-03-27)
last change: 2013-03-27
Add the following property to your mail configuration, substituting the correct name for my.mail.hostname.com:
properties.put("mail.smtp.localhost", "my.mail.hostname.com");