// a multipart may have a preamble
multipart.setPreamble("This is a multi-part message in MIME format.");
// first part is text/plain
StorageBodyFactory bodyFactory = new StorageBodyFactory();
BodyPart textPart = createTextPart(bodyFactory, "Why so serious?");
multipart.addBodyPart(textPart);
// second part is image/png (image is created on the fly)
BufferedImage image = renderSampleImage();