public Attachment addAttachment(String contentId, DataHandler dataHandler) { Assert.hasLength(contentId, "contentId must not be empty"); Assert.notNull(dataHandler, "dataHandler must not be null"); AttachmentPart saajAttachment = getImplementation().addAttachmentPart(getSaajMessage(), dataHandler); saajAttachment.setContentId(contentId); saajAttachment.setMimeHeader(TransportConstants.HEADER_CONTENT_TRANSFER_ENCODING, "binary"); return new SaajAttachment(saajAttachment); }