attachment.setFileName(item.getFilename());
String mimeType = MimeType.getContentTypeByExt(
FolderUtil.getFileExt(item.getFilename()));
DataSource ds = new ByteArrayDataSource(item.getData(), mimeType);
attachment.setDataHandler(new DataHandler(ds));
mp.addBodyPart(attachment);
}
MimeMessage msg = new MimeMessage(session);
msg.setFrom(new InternetAddress(fromAddress, fromText));
msg.addRecipient(Message.RecipientType.TO,
new InternetAddress(toAddress, toAddress));