final Properties properties = Database.query(propertySupplier);
if (properties != null) {
Session session = Session.getInstance(properties,
new javax.mail.Authenticator() {
protected PasswordAuthentication getPasswordAuthentication() {
return new PasswordAuthentication(properties
.getProperty("mail.smtp.user", ""),
properties.getProperty(
"mail.smtp.password", ""));
}
});