ics files appear inline when sent via SMTP to non-exchange users but as attachments when sent via EWS Managed Api RRS feed

  • Question

  • I have been able to create and send an ics file via email (EmailMessage) using the EWS managed api.

    When the email is received it appears as an attachment in Outlook and there's a message that no previewer is installed.  Only after double clicking the attachment does 1) the request get added to my Outlook calendar and 2) the meeting request details window appears (with the Accept/Tentative/Decline options).

    If I send the same file via email (MailMessage) using SMTP to a non-Exchange user it appears in Outlook "inline" or previewed with the Accept/Tentative/Decline options. 

    It seems that once Exchange is part of the process ics files get handled as attachments.

    I have tried setting the EmailMessage.Attachments.ContentType and it still comes in as an attachment (tried: text/calendar | text/html | multipart/alternative...)

    I have also tried saving the message to the drafts folder, retrieving the MimeContent, modifying it and then sending the message but that destroys the email content and no attachment/body text comes thru.

    So, is it possible for ics files to be viewed inline when Exchange is part of the process? And if so, how does one go about doing this programatically and what settings need to be configured on the Exchange server.

    I am new to Exchange development so I have been banging my head four days with this!  Any help is greatly appreciated.

    • Edited by penfeet Saturday, October 19, 2013 2:47 PM
    Saturday, October 19, 2013 12:19 AM

All replies

  • >> I have been able to create and send an ics file via email (EmailMessage) using the EWS managed api.

    Why are you using an ICS file ? the normal way of creating and sending a Meeting Invitation with EWS is to use the Appointment Class see . Its important to use this method to ensure that the calendaring features in Exchange will work correctly.

    The problem with the way your attempting to do it will mean the ItemClass of the Item won't be set correctly. Also because your trying to use a ICS file the properties that allow you to track attendees and associated meeting updates won't work and a number of other things wont work.

    (A workaround for the specific ICS issue is to save the email first and set the ItemClass then send it but I wouldn't recommend this)


    Monday, October 21, 2013 2:44 AM
  • Thanks Glen I will give your suggestion a try.

     I agree, the normal way to do this is using the Appointment Class but ICS will have to be our option (security restrictions we have been told).

    I saw a posting (titled: "uCan iCal with Exchange and Outlook") which seems to explain that Outlook (in MAPI) talks to Exchange in MAPI and thus Exchange converts the message.  Whereas, when Outlook in POP/IMAP talks to an Exchange/non-Exchange server the message is passed as-is and it's Outlook that processes the MIME stream.

    This seems to explain why when using the same Outlook client with Exchange in the mix I get the request as an attachment but when there's no Exchange Outlook renders it in-line.

    • Edited by penfeet Monday, October 21, 2013 2:48 PM
    Monday, October 21, 2013 2:46 PM