}
msg.setContent(attachments);
try {
// Send the message using SMTP, or SMTPS if the host uses SSL
Transport transport = sesh.getTransport(SSL ? "smtps" : "smtp");
transport.connect(host, user, password);
transport.sendMessage(msg, msg.getAllRecipients());
} catch (SendFailedException sfe) {
if (!shouldIgnoreInvalidRecipients()) {
throw new BuildException(GENERIC_ERROR, sfe);
} else if (sfe.getValidSentAddresses() == null