How to set Reminder time to MapiCalendar Object using Aspose.Email for java API

I have to create calendar from MapiCalendar Object. So i have to set Reminder Time. Please provide me some sample code.


You can use the following code sample to get this done.

Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT"));
calendar.set(2016, Calendar.NOVEMBER, 1, 0, 0, 0);
Date startDate = calendar.getTime();
calendar.set(2016, Calendar.DECEMBER, 1);
Date endDate = calendar.getTime();
MailAddressCollection attendees = new MailAddressCollection();
attendees.addItem(new MailAddress("", "Attendee"));
Appointment app = new Appointment("Home", startDate, endDate, new MailAddress("", "Organizer"), attendees);
MailMessage msg = new MailMessage();
MapiMessage mapi = MapiMessage.fromMailMessage(msg);
MapiCalendar cal = (MapiCalendar) mapi.toMapiMessageItem();

cal.setReminderDelta(45); //45 min before start of event

String savedFile = dataDir + "calendarWithDisplayReminder_out.ics";, AppointmentSaveFormat.Ics);