title: PHP send multiple event requests to Outlook/vcalendar
body: <p>I have a PHP file set up to send an event invitation to Outlook/Vcalendar as follows:</p>
  
  <pre><code>    &lt;?php
  
  $message="
  
  BEGIN:VCALENDAR
  VERSION:2.0
  CALSCALE:GREGORIAN
  METHOD:REQUEST
  BEGIN:VEVENT
  DTSTART:20130901T121000Z
  DTEND:20130901T131000Z
  DTSTAMP:20110525T075116Z
  ORGANIZER;CN=From Name:mailto:from email id
  UID:12345678
  ATTENDEE;PARTSTAT=NEEDS-ACTION;RSVP= TRUE;CN=Sample:emailaddress@testemail.com
  DESCRIPTION:Test the first invite
  LOCATION: Test Location
  SEQUENCE:0
  STATUS:CONFIRMED
  SUMMARY:Test the first icalendar invitation
  TRANSP:OPAQUE
  END:VEVENT
  END:VCALENDAR";
  
  /*headers*/
  $headers = "From: From Name &lt;From Mail&gt;\n";
  $headers .= "MIME-Version: 1.0\n";
  $headers .= "Content-Type: text/calendar; method=REQUEST;\n";
  $headers .= '        charset="UTF-8"';
  $headers .= "\n";
  $headers .= "Content-Transfer-Encoding: 7bit";
  
  /*mail content*/
  $subject = "Meeting Subject";
  $subject = html_entity_decode($subject, ENT_QUOTES, 'UTF-8');
  
  /*mail send*/
  if(mail("emailaddress@testemail.com", $subject, $message, $headers))
  
  {
      echo "Your request has been sent";
  }else {
      echo "error";
  }
  
  ?&gt;
  </code></pre>
  
  <p>This works fine. An email is sent to Outlook and when opened, the event is automatically posted to the relevant calendar.</p>
  
  <p>Does anyone know if it is possible to send more than one event that will all be posted when the *<em>single *</em> email is opened.</p>
  
  <p>I have tried repeating the vcalendar events as follows, but only the first event gets posted.</p>
  
  <pre><code>&lt;?php
  
  $message="
  
  BEGIN:VCALENDAR
  VERSION:2.0
  CALSCALE:GREGORIAN
  METHOD:REQUEST
  BEGIN:VEVENT
  DTSTART:20130901T121000Z
  DTEND:20130901T131000Z
  DTSTAMP:20110525T075116Z
  ORGANIZER;CN=From Name:mailto:from email id
  UID:12345678
  ATTENDEE;PARTSTAT=NEEDS-ACTION;RSVP= TRUE;CN=Sample:emailaddress@testemail.com
  DESCRIPTION:Test the first invite
  LOCATION: Test Location
  SEQUENCE:0
  STATUS:CONFIRMED
  SUMMARY:Test the first icalendar invitation
  TRANSP:OPAQUE
  END:VEVENT
  BEGIN:VEVENT
  DTSTART:20131001T121000Z
  DTEND:20131001T131000Z
  DTSTAMP:20110525T075116Z
  ORGANIZER;CN=From Name:mailto:from email id
  UID:12345678
  ATTENDEE;PARTSTAT=NEEDS-ACTION;RSVP= TRUE;CN=Sample:emailaddress@testemail.com
  LOCATION: Test the second location
  SEQUENCE:0
  STATUS:CONFIRMED
  SUMMARY:Test the second icalendar invitation
  TRANSP:OPAQUE
  END:VEVENT
  END:VCALENDAR";
  
  /*headers*/
  $headers = "From: From Name &lt;From Mail&gt;\n";
  $headers .= "MIME-Version: 1.0\n";
  $headers .= "Content-Type: text/calendar; method=REQUEST;\n";
  $headers .= '        charset="UTF-8"';
  $headers .= "\n";
  $headers .= "Content-Transfer-Encoding: 7bit";
  
  /*mail content*/
  $subject = "Meeting Subject";
  $subject = html_entity_decode($subject, ENT_QUOTES, 'UTF-8');
  
  /*mail send*/
  if(mail("emailaddress@testemail.com", $subject, $message, $headers))
  
  {
      echo "Your request has been sent";
  }else {
      echo "error";
  }
  
  ?&gt;
  </code></pre>
  
  <p>I have also tried to encase each calendar event as a separate declaration (ie $message2 etc) and then to repeat this with the if statement but then of course the event gets sent as a separate email.</p>