Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Multipart email with text and calendar: Outlook doesn't recognize ics

I have problems with Outlook 2007. When sending a "multipart/alternative" email with a "text/calendar" part, Outlook recognizes the calendar event, that's how it has to be. But when adding a "text/plain" part, Outlook only displays the plain text, the calendar part is missing (but it's present in the source code of the email).

The source looks like this:

[...]
Content-Type: multipart/alternative;
boundary="_=_swift_v4_138243630552664dd1bc83e_=_"

--_=_swift_v4_138243630552664dd1bc83e_=_
Content-Type: text/plain; charset=utf-8
Content-Transfer-Encoding: quoted-printable

[...the plain message...]

--_=_swift_v4_138243630552664dd1bc83e_=_
Content-Type: text/calendar; charset=utf-8
Content-Transfer-Encoding: quoted-printable

BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//GourmetPortal//NONSGML rr//DE
BEGIN:VEVENT
UID:res-Burkert
CREATED:20131030T113000Z
ORGANIZER;CN=3DSven Burkert:MAILTO:[...]
SUMMARY:[...]
DESCRIPTION:[...]
DTSTART:20131030T113000Z
END:VEVENT
END:VCALENDAR

--_=_swift_v4_138243630552664dd1bc83e_=_--
like image 318
Sven Avatar asked Oct 22 '13 16:10

Sven


People also ask

Do ICS files work with Outlook?

When you open the . ICS file, it will cause Outlook to open automatically. The event itself will open in a separate window. Click Save & Close on the event window to save the event to your calendar.

How do I get an ICS calendar into Outlook?

Enter your email address and password and Sign In to 'Outlook on the web' (OWA) Select the Calendar you want to share. For Select permissions select Full Details and click the Save button. Copy the 'ICS' link (this is the link you need to paste into app you want to share the calendar with)

How do I add an ICS link to an email?

On the Insert tab, in the Links group, click Hyperlink. In the Text to display box, type the text that you to appear as the link. In the Address box, enter the location where you saved the iCalendar . ics file.


2 Answers

You are missing the iTIP method, both in the content-type:

Content-Type: text/calendar; charset="utf-8"; method=REQUEST

and as a VCALENDAR property as well:

BEGIN:VCALENDAR
VERSION:2.0
METHOD:REQUEST
PRODID:-//GourmetPortal//NONSGML rr//DE

The method might be PUBLISH or REQUEST (in which case you also miss some ATTENDEE property).

Then, some clients are ignoring iMIP in multipart/alternative and are looking only as attachments so you may need to try the following structure:

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

Essentially, you are adding the attachment twice. iMIP invitation from google/yahoo calendar and lightning have such a structure.

like image 78
Arnaud Quillaud Avatar answered Dec 24 '22 08:12

Arnaud Quillaud


To make sure Outlook always recognizes the iCal part, create a message where text/calendar is the only MIME part. Everything else (body, attachments, etc.) should be embedded in the VEVENT part.

like image 44
Dmitry Streblechenko Avatar answered Dec 24 '22 08:12

Dmitry Streblechenko