Hi

I am trying to send multiple attachments at a single time
I tried this ..did not work

what should I do ?



for(int i=0;i<2;i++) {
      String filename = "c:/example.txt";

      // attach the file to the message
     FileDataSource fds = new FileDataSource(filename);
     mbp2.setDataHandler(new DataHandler(fds));
     mbp2.setFileName(fds.getName());

      //  if (filename == "c:/example.txt") filename = "c:/test.txt";
     // create the Multipart and its parts to it
     Multipart mp = new MimeMultipart();
     mp.addBodyPart(mbp1);
     mp.addBodyPart(mbp2);

     // add the Multipart to the message
     msg.setContent(mp);

     }
     //msg.setHeader("X-Mailer", mailer);
     msg.setSentDate(new Date());


Thanks ...!!!!
Daniel.E

===========================================================================
To unsubscribe: mailto [EMAIL PROTECTED] with body: "signoff JSP-INTEREST".
For digest: mailto [EMAIL PROTECTED] with body: "set JSP-INTEREST DIGEST".
Some relevant FAQs on JSP/Servlets can be found at:

 http://archives.java.sun.com/jsp-interest.html
 http://java.sun.com/products/jsp/faq.html
 http://www.esperanto.org.nz/jsp/jspfaq.jsp
 http://www.jguru.com/faq/index.jsp
 http://www.jspinsider.com

Reply via email to