14

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_=_--
Sven
  • 722
  • 1
  • 7
  • 25

2 Answers2

22

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.

Arnaud Quillaud
  • 4,420
  • 1
  • 12
  • 8
  • I've changed the mail, it looks like this now: `Content-Type: text/calendar; method=PUBLISH; charset=utf-8 Content-Transfer-Encoding: quoted-printable BEGIN:VCALENDAR VERSION:2.0 METHOD:PUBLISH` But Outlook still doesn't recognize the calendar event. The problem seems to be something else. Like I mentioned in my first post, everything works fine when removing the text/plain part. – Sven Oct 23 '13 at 13:15
  • Thanks, that's the solution: The calendar file has to be added as file attachment`, that means we have these headers: `Content-Type: text/plain; name=myCalendar.ics Content-Disposition: attachment; filename=myCalendar.ics` – Sven Oct 24 '13 at 13:36
  • 1
    @arnaudq Do you have a working example of how to create such a structure? – RonyK Mar 14 '16 at 11:38
  • @ArnaudQuillaud Could you please have a look at [this question](https://stackoverflow.com/questions/63733904/cannot-see-event-title-in-the-email-invitation-on-microsoft-outlook) too? – a_sid Sep 06 '20 at 01:01
  • 1
    Could you please elaborate this answer instead of just code blocks? I'm not sure what you are telling and ho to use these! Thanks in advance – Shahriar Rahman Zahin Feb 22 '21 at 18:14
9

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.

Dmitry Streblechenko
  • 62,942
  • 4
  • 53
  • 78
  • Attachments in the VEVENT? Is this possible? Why has the text/calendar part to be the only mime part? Is there a known Outlook bug? – Sven Oct 22 '13 at 20:16
  • 1
    Sure, that is what "ATTACH" header is for (you can have more than one). Outlook needs to be able to recognize the message as a meeting invitation, which means the main part should be text/calendar. If you can make it the *only* part, Outlook will definitely recognize the meeting invitation. – Dmitry Streblechenko Oct 23 '13 at 15:29
  • @DmitryStreblechenko Could you also have a look [this question](https://stackoverflow.com/questions/63733904/cannot-see-event-title-in-the-email-invitation-on-microsoft-outlook) of mine? I am struggling to understand why Outlook is not recognizing the event name in my email invitation. – a_sid Sep 06 '20 at 01:05