*/
private static BodyPart createImagePart(StorageBodyFactory bodyFactory,
BufferedImage image) throws IOException {
// Create a binary message body from the image
StorageProvider storageProvider = bodyFactory.getStorageProvider();
Storage storage = storeImage(storageProvider, image, "png");
BinaryBody body = bodyFactory.binaryBody(storage);
// Create a body part with the correct MIME-type and transfer encoding
BodyPart bodyPart = new BodyPart();
bodyPart.setBody(body, "image/png");