code: private void addAttachment(Multipart multipart, Attachment attachment) throws AttachmentResourceHandlerException {
  		MimeBodyPart part = new MimeBodyPart();
  		try {
  			part.setFileName(attachment.getResource().getName());
  			part.setDisposition(attachment.getDisposition());
  			part.setDescription(attachment.getDescription());
  			part.setContentID(attachment.getContentId());
  			attachmentHandler.setData(part, attachment.getResource(), attachment);
  			multipart.addBodyPart(part);
  		} catch (MessagingException e) {
  			throw new AttachmentResourceHandlerException("Failed to attach " + attachment.getResource().getName(), attachment, e);
  		}
  	}
docs: Add an attachment on the mime message.
  
  @param multipart
  the mime message to fill
  @param attachment
  the attachment to add
  @throws AttachmentResourceHandlerException
  when the attachment couldn't be attached