Thank you for your valuable information. Code is working fine. I am able to add attachment also by adding following code.
private Multipart _multipart; _multipart = new MimeMultipart(); public void addAttachment(String filename,String subject) throws Exception { BodyPart messageBodyPart = new MimeBodyPart(); DataSource source = new FileDataSource(filename); messageBodyPart.setDataHandler(new DataHandler(source)); messageBodyPart.setFileName(filename); _multipart.addBodyPart(messageBodyPart); BodyPart messageBodyPart2 = new MimeBodyPart(); messageBodyPart2.setText(subject); _multipart.addBodyPart(messageBodyPart2); } message.setContent(_multipart);