I need to send a PDF file using JavaMail. The PDF is currently a byte[]. How do I get it into the DataSource?
byte[] pdffile = ....
messageBodyPart = new MimeBodyPart();
DataSource source = ???
messageBodyPart.setDataHandler(new DataHandler(source));
messageBodyPart.setFileName(filename);
multipart.addBodyPart(messageBodyPart);