[Solved] Working code that sends only one attachment


you can alternatively write code like this ,

Multipart _multipart = new MimeMultipart("test");
for (String str : attachment_List) {
    MimeBodyPart messageBodyPart = new MimeBodyPart();
    DataSource source = new FileDataSource(str);
    messageBodyPart.setDataHandler(new DataHandler(source));
    messageBodyPart.setFileName(source.getName());
    multipart.addBodyPart(messageBodyPart);
}
_msg.setContent(_multipart);
Transport.send(_msg);

solved Working code that sends only one attachment