try {
fromUser = new MessageRecipient();
fromUser.setAddress(new InternetAddress("mps@volantis.com"));
Session session = new Session();
session.addRecipients("toList", recipients);
session.addRecipients("ccList", ccRecipients);
session.addRecipients("bccList", bccRecipients);
// debug output
if (genMessage) {
outputFile = saveMessages(session, message, "toList",
"ccList", "bccList", fromUser);
}
// Save failures for display later on
failures = session.send(message, "toList",
"ccList", "bccList", fromUser);
} catch (Exception rec) {
logger.error("Error sending message ", rec);
writeError(request, response, rec);