I got a javax.mail.Session named lSession, and a MimeMessage lMessage :
Session lSession = Session.getDefaultInstance(properties);
MimeMessage lMessage = new
Try this code,
DataHandler lDataHandler = new DataHandler(new ByteArrayDataSource(fichierByteVO.getFile(), fichierByteVO.getMIMEType()));
lMessageBodyPart.setDataHandler(lDataHandler);
Try this code:
MimeBodyPart att = new MimeBodyPart();
ByteArrayDataSource bds = new ByteArrayDataSource(bytearray, "AttName");
att.setDataHandler(new DataHandler(bds));
att.setFileName(bds.getName());