code: private MimeMultipart toMimeMultipart(List<DataSource> bodyPartContents)
              throws MessagingException, IOException {
          String changeSetId = String.format("changeset_%s", UUID.randomUUID()
                  .toString());
          MimeMultipart changeSets = createChangeSets(bodyPartContents,
                  changeSetId);
          MimeBodyPart mimeBodyPart = createMimeBodyPart(changeSets, changeSetId);
  
          MimeMultipart mimeMultipart = new BatchMimeMultipart(
                  new SetBoundaryMultipartDataSource(batchId));
          mimeMultipart.addBodyPart(mimeBodyPart);
          return mimeMultipart;
  
      }
docs: To mime multipart.
  
  @param bodyPartContents
  the body part contents
  @return the mime multipart
  @throws MessagingException
  the messaging exception
  @throws IOException
  Signals that an I/O exception has occurred.