2009-02-26 13:52:03 UTC
I'm currently working on sending out group scheduling mailings and I seem to be able to send out individual schedules and the headers appear but if I send to 2 or more people, the calendaring data becomes lost in MS Outlook 2007. Anyone have any ideas on this at all, please?
CalendarOutputter co = new CalendarOutputter(false);
Multipart multipart = new MimeMultipart();
//set the calendar as a string inside body of email
BodyPart messageBodyPart = new MimeBodyPart();
Writer wtr = new StringWriter();
co.output(cal, wtr);
String content = wtr.toString();
messageBodyPart.setContent(content, "text/calendar;method=REQUEST;charset=\"us-ascii\"");
multipart.addBodyPart(messageBodyPart);
msg.setContent(multipart);
and using sendMessage to send to all recipients. Is there also a wayof getting the results of co.output() into a file which could be attached as FileOutputStream is dumping the contents and its seems messy to output the file then read it back in again.