I have created an ICS file from the Aspose Email for Java using the following code from aspose documentation
// ExStart: WriteMultipleEventsToICS
IcsSaveOptions saveOptions = new IcsSaveOptions();
saveOptions.setAction(AppointmentAction.Create);
CalendarWriter writer = new CalendarWriter("WriteMultipleEventsToICS_out.ics", saveOptions);
//Set the start and end date of meeting
Calendar c = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
MailAddressCollection attendees = new MailAddressCollection();
attendees.addItem(new MailAddress("sarthak.garg@abc.com"));
attendees.addItem(new MailAddress("jerin.joseph@abc.com"));
try {
for (int i = 0; i < 10; i++) {
c.set(2019, 06, 1 + i, 22, 00, 11);
Date startDate = c.getTime();
c.set(2019, 06, 1 + i, 22, 30, 11);
Date endDate = c.getTime();
//create Appointment instance
Appointment app = new Appointment("Room 112", //location
startDate, //start time
endDate, //end time
new MailAddress("kapil.gupta@abc.com"), //organizer
attendees //attendee
);
app.setDescription("Test body " + i);
app.setSummary("Test summary:" + i);
writer.write(app);
}
} finally {
writer.dispose();
}
Please find the generated ics file in the zip below.
WriteMultipleEventsToICS_out.zip (1.0 KB)
I am sending it as attachment to the attendees,
In the Windows Outlook Desktop Client(Office 365) , when the user clicks on the attachment, it only shows the first event.
However on the Outlook webclient, when the user clicks on add to calendar, all the events are added to the calender, without any issue.
Please let us know if there is any special handling for the outlook desktop client.
Thanks
Kapil