private static MimeBodyPart createAttachmentPart(DataSource attachment) throws MessagingException {
  MimeBodyPart attachmentPart=new MimeBodyPart();
  attachmentPart.setDataHandler(new DataHandler(attachment));
  attachmentPart.setDisposition(Part.ATTACHMENT);
  attachmentPart.setFileName(attachment.getName());
  return attachmentPart;
}

private static MimeBodyPart createAttachmentPart ( DataSource attachment ) throws MessagingException { MimeBodyPart attachmentPart = new MimeBodyPart ( ) ; attachmentPart . setDataHandler ( new DataHandler ( attachment ) ) ; attachmentPart . setDisposition ( Part . ATTACHMENT ) ; attachmentPart . setFileName ( attachment . getName ( ) ) ; return attachmentPart ; }
creates the attachment part .
