code: public static MimeBodyPart newAttachmentBodyPart( String content, String contentId, String mimeType, String fileName)
      throws MessagingException, IOException
    {
      MimeBodyPart mimeBodyPart = new MimeBodyPart();
  //    log.debug("Creating an attachment for content '{}', mimeType '{}', fileName '{}'.", new Object[] {content, mimeType, fileName});
      mimeBodyPart.setDataHandler(new DataHandler(new ByteArrayDataSource(content, mimeType + UTF_8_CHARACTER_SET)));
      if( contentId != null ) {
        mimeBodyPart.setHeader("Content-ID", contentId);
      }
      mimeBodyPart.setDisposition(DISPOSITION_ATTACHMENT);
      if( fileName != null ) {
        mimeBodyPart.setFileName(fileName);
      }
      return mimeBodyPart;
    }
docs: Creates a body part for an attachment that is downloaded by the user.
  @throws IOException