Assume you have an incoming mail enabled SharePoint calendar, you send meeting requests to the calendar and need to access their properties (like the start or end time of the meeting) from the code of your SPEmailEventReceiver.
The incoming meeting requests contain the information about the meeting as a separate attachment in the iCalendar format.
You can read about the iCalendar standard on Wikipedia, like
“By default, iCalendar uses the UTF-8 character set.”
“iCalendar data has the MIME content type text/calendar.”
Although for parsing this content you can’t find the necessary methods in the core SharePoint object model, SharePoint uses the CalendarReader (and related) objects located in the Microsoft.Internal.Mime assembly from GAC when processing incoming meeting requests.
The following code illustrates, how to get a property by its name (see the Wikipedia article for possible values) from the SPEmailMessage object received in your event handler.
Because it is rather cumbersome to test event receivers, you can temporarily stop the SPTimer service (don’t forget to restart it later!), send your meeting request to SharePoint, and when the mail arrives to the Drop folder of SMTP, copy a backup to another folder. Next, you can use a console application with a method like this one below to read the SPEmailMessage directly from the file:
The sample method above reads the UID property of the meeting that is an internal ID to look up and update former corresponding calendar items.