try {
email.setFrom(from);
email.addTo(to);
if(!StringUtils.isEmpty(subject)) email.setSubject(subject);
if(!StringUtils.isEmpty(message)) email.setMsg(message);
email.send();
logger.debug("Sent email to '{}' with subject '{}'.", to, subject);
success = true;
} catch (EmailException e) {
logger.error("Could not send e-mail to '" + to + "‘.", e);
}