Properties props = System.getProperties();
props.put("mail.smtp.auth", Boolean.toString(SMTP_IS_AUTH));
props.put("mail.smtp.starttls.enable", Boolean.toString(SMTP_STARTTLS));
Address[] recipients = message.getRecipients(Message.RecipientType.TO);
Session session = Session.getDefaultInstance(props);
<BUG>Transport transport = session.getTransport("smtp");

try {
Server.logTrace("SMTP connecting to " + SMTP_HOST + ":" + SMTP_PORT + ".");</BUG>
transport.connect(SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD);

Properties props = System.getProperties();
props.put("mail.smtp.auth", Boolean.toString(SMTP_IS_AUTH));
props.put("mail.smtp.starttls.enable", Boolean.toString(SMTP_STARTTLS));
Address[] recipients = message.getRecipients(Message.RecipientType.TO);
Session session = Session.getDefaultInstance(props);
SMTPTransport transport = (SMTPTransport) session.getTransport("smtp");
try {
transport.setLocalHost(HOSTNAME);
Server.logTrace("SMTP connecting to " + SMTP_HOST + ":" + SMTP_PORT + ".");
transport.connect(SMTP_HOST, SMTP_PORT, SMTP_USER, SMTP_PASSWORD);
