We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Creating ICS Appointment File Wish Aspose for Java

Dear Sir/Madam,

is there anyway of creating an ICS file using Aspose for Java?

I’ve seen that it’s possible with C# and VB:
http://www.aspose.com/docs/display/emailnet/Load+and+Save+Appointment+in+ICS+Format

Do you have this feature for Java?

Kind regards,
JP (on behalf of Renato).

Hi JP,


Thank you for writing to Aspose support team.

You can use Aspose.Email for Java to create an ICS appointment file. Please have a look at the following code sample for your kind reference and let us know if we can be of any additional help to you in this regard.

Sample Code:

String
sender =
"test@gmail.com";<o:p></o:p>

String recipient = "test@email.com";

MailMessagemessage = newMailMessage(sender, recipient, "", "");

Calendar calendar = Calendar.getInstance(TimeZone.getTimeZone("GMT"));

calendar.set(2012, Calendar.NOVEMBER, 1, 0, 0, 0);

Date startDate = calendar.getTime();

calendar.set(2012, Calendar.DECEMBER, 1);

Date endDate = calendar.getTime();

MailAddressCollection attendees = newMailAddressCollection();

attendees.add("attendee1@domain.com");

WeeklyRecurrencePattern expected = newWeeklyRecurrencePattern(3);

Appointment app = newAppointment("Appointment Location", "Appointment Summary", "Appointment Description",

startDate, endDate,

newMailAddress("organizer_address@aspose.com", "Organizer"), attendees, expected);

//If you don’t want to set the appointment as draft, comment this line

app.setMethod(AppointmentMethodType.Publish);

app.save(“TestAppointment.ics”, AppointmentSaveFormat.Ics);