StringBuilder body = new StringBuilder();
body.append("Your current SMTP configuration is valid!");
request.getBodyContext().put(DefaultMailType.BODY_KEY, body.toString());
MailRequestStatus status = emailer.sendSyncedMail(request);
if (status.getErrorCause() != null) {
log.error("Unable to send e-mail", status.getErrorCause());
throw new EmailerException("Unable to send e-mail", status.getErrorCause());
}
return status.isSent();
}