4
votes

We have a .NET application that manually generates meeting invites to send to users. The process we use is as follows:

  • Create a System.Net.Mail.MailMessage and set the usual fields (from/to/subject/etc) And the meeting info as an attachment (ICS File), 7bit encoding - this is necessary for mail clients that don't recognize Outlook-style invites
  • Add two alternate views, text/plain and text/html, both 7bit encoded for the text of the email
  • Add another alternate view with "text/calendar; charset=UTF-8; method=REQUEST" with the same ICS text as the attached ICS file above, also 7bit encoded
  • Send message

This worked fine with a traditional Outlook 2007 / Exchange setup (the attachment is not visible and the message is treated as a meeting request), but once we upgraded to Outlook 2010/Office 365 the embedded ICS data is not recognized and the message shows up as a regular message with an ICS file attached. Removing the attachment results in a correctly recognized message. We are not sure whether it's the new Outlook version or Office 365 that are causing the change, but it has to be one of them.

Does anyone have any idea why this changed and how we can fix it?

3
Has anyone figured out an answer and just not posted the answer? we are having the same issues. Did you find a work around?thames

3 Answers

2
votes

We faced the similar issue. In our case, our mail server was upgraded from exchange 2003 to exchange 2010, our company migrated some people's email accounts to 2010. We are still using outlook 2007 as front end. We have a .NET app that creates meeting invitations as Alernative View and send it to recipients. Those whose email accounts got migrated no longer receive invitations as meeting requests, but just plain email. Those who stays in exchange 2003 have no problem getting the invitations as the meeting request. I searched online and found exchange 2010 changed the way it processes .ics file and it is more restrictive than previous version. The worst part is it does not follow RFC standard and microsoft thinks it is not their concern to try to figure out which part was preventing their exchange 2010 to interpret .ics correctly. So my workaround is not to send out .ics as alternative view, but send it as an attachment. When it is received in the email accounts that have been migrated to 2010, the attachment can be seen by the user and the user can click the attachment to import it to their calendars.

0
votes

Outlook/Exchange expects the message type to be text/calendar, not text/multipart.

0
votes

I got this problem recently when using System.Net.Mail:

  1. Send email with iCalendar as an alternative view (text/calendar) without attachment: It works. - I used iCal.Net to generate iCalendar message.
  2. Send email with iCalendar as an alternative view (text/calendar) with attachment: It works on Windows 10 Mail, but It didn't work with Outlook365.

The root cause of this problem is: When your email contain attachments, MailMessage will generate message like this:

multipart/mixed
  multipart/alternative
    text/plain
    text/calendar;method=REQUEST
  multipart/mixed
    content-type (with a content-disposition:attachment)

But Outlook365 expect the message to be:

multipart/mixed
  multipart/alternative
    text/plain
    text/calendar;method=REQUEST
  content-type (with a content-disposition:attachment)

When Outlook receive wrong attachment format. Some how, It'll ignore the calendar part.

My solution: I decided to use MailKit to send email instead of System.Net.Mail.By using this library I can control the message format.