Posted By:
Becky_Givner
Posted On:
Thursday, July 5, 2001 09:34 AM
To send multiple attachments, create a body part for each file that you want to send.
Check out the sample code from this tutorial on the JavaMail API:
http://developer.java.sun.com/developer/onlineTraining/JavaMail/contents.html#SendingAttachments
Here is the code you would need to repeat per file:
messageBodyPart = new MimeBodyPart();
DataSource source = new FileDataSource(filename);
messageBodyPart.setDataHandler(new DataHandler(source));
messageBodyPart.setFileName(filename);
multipart.addBodyPart(messageBodyPart);