// requires !1003225 (JavaMail) import javax.mail.*; import javax.mail.PasswordAuthentication; import javax.mail.internet.*; static Session gmailSendSession(fS user, S pass) { if (pass == null) pass = findGMailPassword(user); final S _pass = pass; new Properties props; props.put("mail.smtp.auth", "true"); props.put("mail.smtp.starttls.enable", "true"); props.put("mail.smtp.host", "smtp.gmail.com"); props.put("mail.smtp.port", "587"); ret Session.getInstance(props, new javax.mail.Authenticator() { protected PasswordAuthentication getPasswordAuthentication() { return new PasswordAuthentication(user, _pass); } }); }