code: public AttachmentPart createAttachmentPart(
          Object content,
          String contentType) {
          AttachmentPart attachment = createAttachmentPart();
          attachment.setContent(content, contentType);
          return attachment;
      }
docs: Creates an <code>AttachmentPart</code> object and populates it with
  the specified data of the specified content type. The type of the
  <code>Object</code> should correspond to the value given for the
  <code>Content-Type</code>.
  
  @param content
  an <code>Object</code> containing the content for the
  <code>AttachmentPart</code> object to be created
  @param contentType
  a <code>String</code> object giving the type of content;
  examples are "text/xml", "text/plain", and "image/jpeg"
  @return a new <code>AttachmentPart</code> object that contains the
  given data
  @exception IllegalArgumentException
  may be thrown if the contentType does not match the type
  of the content object, or if there was no
  <code>DataContentHandler</code> object for the given
  content object
  @see javax.activation.DataHandler
  @see javax.activation.DataContentHandler