Multipart multipart = new MimeMultipart();
multipart.addBodyPart(bp1);
multipart.addBodyPart(bp2);
baseMsg.setFrom(new InternetAddress("Ted <ted@home.com>"));
baseMsg.setRecipient(Message.RecipientType.TO, new InternetAddress(
"success@subethamail.org"));
baseMsg.setSubject("Test Big attached file message");
baseMsg.setContent(multipart);
baseMsg.saveChanges();
log.debug("Send started");
Transport t = new SMTPTransport(session, new URLName("smtp://localhost:"+SMTP_PORT));
long started = System.currentTimeMillis();
t.connect();
t.sendMessage(baseMsg, new Address[] {new InternetAddress(
"success@subethamail.org")});
t.close();
started = System.currentTimeMillis() - started;
log.info("Elapsed ms = "+started);