6.2.3 mail.smtp.connectiontimeout
mail.smtp.connectiontimeout specifies the socket connection time-out value in milliseconds.
Description
mail.smtp.connectiontimeout specifies the socket connection time-out value in milliseconds. This time-out is implemented using java.net.Socket. The default value is -1. If the time-out value is 0 or the default value, then it is interpreted as an infinite time-out.
Specifiable values
Type: Integer
-1 to 2147483647
Example
Properties properties = new Properties();
properties.setProperty("mail.smtp.connectiontimeout", "30");
Session session = Session.getDefaultInstance(properties);
Message message = new MimeMessage(session);
message.setSubject(sentDate);
Transport.send(message);