6.2.5 mail.smtp.localhost
mail.smtp.localhost specifies the name of the localhost that is used in the SMTP HELO or EHLO commands.
Description
mail.smtp.localhost specifies the name of the localhost that is used in the SMTP HELO or EHLO commands. The default value is InetAddress.getLocalHost().getCanonicalHostName(). If the JDK and naming service are configured correctly, then you are not required set the name of the localhost.
Specifiable values
Type: String
Default value
- If the definition item is omitted
-
Return value of java.net.InetAddress.getLocalHost().getCanonicalHostName()
Example
Properties properties = new Properties(); properties.setProperty("mail.smtp.localhost", "localhost"); Session session = Session.getDefaultInstance(properties); Message message = new MimeMessage(session); message.setSubject(sentDate); Transport.send(message);