gregjer gregjer - 2 years ago 359
C# Question

iCalendar does not create an event for organizer

I’m trying to create an event in my Microsoft Outlook calendar by using iCalendar standard. I’ve sent an email with content type “text/calendar” to my Exchange mailbox from .NET application.
It arrives to Outlook as an meeting request. Everything looks good, till the moment when I click the received meeting request, Outlook displays it as an empty calendar view with the text: “Meeting cannot be found in the calendar”.
I don’t understand why – I wanted to create an event and it is trying to find some existing?

If I send exactly the same email to whoever participant of the meeting except the organizer, it creates an event in their calendars and everything seems to be ok.
I’ve found that it is caused by the “ORGANIZER” property. If it is set to organizer’s email (my email) and I send meeting request to myself, an event is not created with the information “Meeting cannot be found in the calendar”.

So the question is why it doesn’t create an event for organizer? Organizer must have that event created to be notified by other participants if they have accepted or cancelled the meeting.

Here is the iCalendar:

PRODID:-//Company//Product 3.0//EN
ORGANIZER;CN="John Doe":mailto:[email protected]
UID:[email protected]
;X-NUM-GUESTS=0:mailto:[email protected]
SUMMARY:Booking test

Answer Source

Let’s say that organizer want to create an meeting for 2 attendees. He fills in a form in the booking system. The booking system sends email containing iCalendar standard to himself and to 2 meeting attendees.

This scenario doesn’t work.

It is not possible to create an event (cancellable meeting object) in the calendar of the organizer. The client thinks that email containing iCalendar format is just notification for attendee of the meeting already created in the organizer calendar. If such an email arrives to organizer’s mailbox, client app doesn’t create an event in the organizer’s calendar. It assumes that an event was created by organizer himself. E.g.: Outlook tells you in that case that “Meeting cannot be found in the calendar”.

If you ask Microsoft support about it, they only tell you that they does not support open standards:

Working solution to this problem is to use platform services (Exchange Web Services or Google Calendar API) to create an event in the organizer’s calendar. Forget iCalendar standard. The services can be configured for sending notifications to attendees automatically. So it is enough to pass “SendInvitationsMode.SendToAllAndSaveCopy” if you’re using EWS:

Appointment appointment = new Appointment(service);
appointment.Subject = "Status Meeting";
appointment.Body = "The purpose of this meeting is to discuss status.";
appointment.Start = new DateTime(2014, 3, 1, 9, 0, 0);
appointment.End = appointment.Start.AddHours(2);
appointment.Location = "Conf Room";
appointment.RequiredAttendees.Add("[email protected]");
appointment.RequiredAttendees.Add("[email protected]");
appointment.OptionalAttendees.Add("[email protected]");  

or set “sendNotifications” parameter to true in case of Google Calendar API.

You don’t need to send an email to every particular attendee.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download