title: Ical .ics non-readable by Office 365
body: <p>I'm trying to send a meeting request with an Ical and PhpMailer. I join the Ical as a StringAttachment with my mail. If i download the attachment, i can read it with a desktop Outlook but i try to open it with Office 365 and i have an alert that say : "The .ICS attachment can't be viewed because the format is not supported.". On google calendar i can't import it either. </p>
  
  <pre><code>$ical = "BEGIN:VCALENDAR\r\n";
  $ical .= "VERSION:2.0\r\n";
  $ical .= "METHOD:REQUEST\r\n";  
  $ical .= "BEGIN:VEVENT\r\n";
  $ical .= "BEGIN:VTIMEZONE\r\n";
  $ical .= "TZID:Europe/Paris\r\n";
  $ical .= "X-LIC-LOCATION:Europe/Paris\r\n";
  $ical .= "BEGIN:DAYLIGHT\r\n";
  $ical .= "TZOFFSETFROM:+0100\r\n";
  $ical .= "TZOFFSETTO:+0200\r\n";
  $ical .= "TZNAME:CEST\r\n";
  $ical .= "DTSTART:19700329T020000\r\n";
  $ical .= "RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=3\r\n";
  $ical .= "END:DAYLIGHT\r\n";
  $ical .= "BEGIN:STANDARD\r\n";
  $ical .= "TZOFFSETFROM:+0200\r\n";
  $ical .= "TZOFFSETTO:+0100\r\n";
  $ical .= "TZNAME:CET\r\n";
  $ical .= "DTSTART:19701025T030000\r\n";
  $ical .= "RRULE:FREQ=YEARLY;INTERVAL=1;BYDAY=-1SU;BYMONTH=10\r\n";
  $ical .= "END:STANDARD\r\n";
  $ical .= "END:VTIMEZONE\r\n"; 
  $ical .= "ORGANIZER:MAILTO:hgdfsghdsfghsd@gmail.com\r\n";
  $ical .= "ATTENDEE;PARTSTAT=ACCEPTED:MAILTO:ghhgjkgh@gmail.com\r\n";
  $ical .= "UID:".strtoupper(md5($interId))."-*****.fr\r\n";
  $ical .= "METHOD:REQUEST\r\n";
  $ical .= "SEQUENCE:1";
  $ical .= "STATUS:".$status."\r\n";
  $ical .= "DTSTART:".$startDate-&gt;format('Ymd').'T'.$startDate-&gt;format('His')."\r\n";
  $ical .= "DTEND:".$endDate-&gt;format('Ymd').'T'.$endDate-&gt;format('His')."\r\n";
  $ical .= "LOCATION:".$shopName."\r\n";
  $ical .= "SUMMARY:".$summary."\r\n";
  $ical .= "DESCRIPTION:\r\n";
  $ical .= "BEGIN:VALARM\r\n";
  $ical .= "TRIGGER:-PT15M\r\n";
  $ical .= "ACTION:DISPLAY\r\n";
  $ical .= "DESCRIPTION:Reminder\r\n";
  $ical .= "END:VALARM\r\n";
  $ical .= "END:VEVENT\r\n";
  $ical .= "END:VCALENDAR\r\n";
  
  $mail-&gt;AddStringAttachment($ical, "Invite.ics", "base64", "text/calendar; charset=utf-8; method=REQUEST");
  </code></pre>
  
  <p>I want the invite to be readable by gmail and office 365, but I don't understand what's wrong with my ical. Do you have any ideas?</p>
  
  <p>Thanks</p>