This week's book giveaway is in the Agile and other Processes forum. We're giving away four copies of The Mikado Method and have Ola Ellnestam and Daniel Brolund on-line! See this thread for details.
How do I attach multiple files to an email using a java application. I'm able to send emails to multiple people and the file names but not the actual files. Any help would be appreciated thanks here is part of my code //================================= // mailCopy method //================================= // // public static void mailCopy(String s, String[] emailAddress) { for (int emailCount = 0; emailCount < emailAddress.length; emailCount++) { sendEmail(s, emailAddress[emailCount]); } } // //==================== // SendEmail method //==================== // public static void sendEmail(String s, String toAddress) { try { String boundary = "DataSeparatorString"; System.getProperties().put("mail.host","company.com"); URL u = new URL("mailto: <" + toAddress + ">"); URLConnection c = u.openConnection(); c.setDoInput(false); c.setDoOutput(true); // System.out.println("Connecting..."); System.out.flush(); c.connect(); PrintWriter out = new PrintWriter(new OutputStreamWriter(c.getOutputStream())); out.print("From: \"my name\" <name@hotmail.com>\n"); out.print("To: " + toAddress + "\n"); out.print("Subject: files copied to hist\n"); out.print(s + "\n"); out.close(); System.out.println("Message send to "+toAddress); } catch (Exception e) { System.err.println(e); System.err.println("Usage: SendMail [<mailhost>]"); } } // Ben [This message has been edited by ben patrick (edited March 06, 2001).]