I have an issue with a generated iCal file.
It appears to be generating the code correctly and the .ics file is loaded with multiple events, however when I open the file in outlook it only imports the first event into my calendar and the rest are not added.
Here is the Generated iCal File
BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN
VERSION:2.0
METHOD:PUBLISH
X-WR-CALNAME: Calendar
CALSCALE:GREGORIAN
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VTIMEZONE
TZID:Europe/London
BEGIN:DAYLIGHT
TZOFFSETFROM:+0000
TZOFFSETTO:+0100
DTSTART:19810329T010000
RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU
TZNAME:BST
END:DAYLIGHT
BEGIN:STANDARD
TZOFFSETFROM:+0100
TZOFFSETTO:+0000
DTSTART:19961027T020000
RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU
TZNAME:GMT
END:STANDARD
END:VTIMEZONE
BEGIN:VEVENT
DTSTART:20140906T090000
DTEND:20140906T170000
UID:224
DTSTAMP:20140721T102908
LOCATION:
DESCRIPTION:Explore the College with current students\, chat with the Director of Studies in your subject\, meet our admissions tutors\,
URL;VALUE=URI:http://www.domain.com/events-224
SUMMARY:Open Day (undergraduate)
END:VEVENT
BEGIN:VEVENT
DTSTART:20141208T000000
DTEND:20141212T000000
UID:416
DTSTAMP:20140721T102908
LOCATION:
DESCRIPTION:Admissions Interviews
URL;VALUE=URI:http://www.domain.com/events-416
SUMMARY:Admissions Interviews
END:VEVENT
BEGIN:VEVENT
DTSTART:20141215T000000
DTEND:20141218T000000
UID:417
DTSTAMP:20140721T102908
LOCATION:
DESCRIPTION:Admissions Interviews
URL;VALUE=URI:http://www.domain.com/events-417
SUMMARY:Admissions Interviews
END:VEVENT
BEGIN:VEVENT
DTSTART:20150112T000000
DTEND:20150116T000000
UID:419
DTSTAMP:20140721T102908
LOCATION:
DESCRIPTION:Admissions Interviews
URL;VALUE=URI:http://www.domain.com/events-419
SUMMARY:Admissions Interviews
END:VEVENT
BEGIN:VEVENT
DTSTART:20150314T000000
DTEND:20150314T000000
UID:67
DTSTAMP:20140721T102908
LOCATION:
DESCRIPTION:Explore the College with current students\, chat with the Director of Studies in your subject and meet our admissions tutors.
URL;VALUE=URI:http://www.domain.com/events-67
SUMMARY:Admissions Open Day (Arts)
END:VEVENT
BEGIN:VEVENT
DTSTART:20150425T000000
DTEND:20150425T000000
UID:73
DTSTAMP:20140721T102908
LOCATION:
DESCRIPTION:Explore the College with current students\, chat with the Director of Studies in your subject and meet our admissions tutors.
URL;VALUE=URI:http://www.domain.com/events-73
SUMMARY:Admissions Open Day (Sciences)
END:VEVENT
END:VCALENDAR
The following is the variables for setting the header and footer of the iCal file
$iCalHeader = "" .
"BEGIN:VCALENDAR\n" .
"PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN\n" .
"VERSION:2.0\n" .
"METHOD:PUBLISH\n";
$iCalHeaderBottom = "CALSCALE:GREGORIAN\n" .
"X-MS-OLK-FORCEINSPECTOROPEN:TRUE\n" .
"BEGIN:VTIMEZONE\n" .
"TZID:Europe/London\n" .
"BEGIN:DAYLIGHT\n" .
"TZOFFSETFROM:+0000\n" .
"TZOFFSETTO:+0100\n" .
"DTSTART:19810329T010000\n" .
"RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU\n" .
"TZNAME:BST\n" .
"END:DAYLIGHT\n" .
"BEGIN:STANDARD\n" .
"TZOFFSETFROM:+0100\n" .
"TZOFFSETTO:+0000\n" .
"DTSTART:19961027T020000\n" .
"RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU\n" .
"TZNAME:GMT\n" .
"END:STANDARD\n" .
"END:VTIMEZONE\n";
$iCalFooter = "END:VCALENDAR";
And finally the code that generates the event
$iCal .= "BEGIN:VEVENT\n".
"DTSTART:" . date('Ymd\THis', strtotime($row2["EVENT_StartDateTime"])) ."\n".
"DTEND:" . date('Ymd\THis', strtotime($row2["EVENT_EndDateTime"])) . "\n".
"UID:" . $row2["EVENT_ID"] . "\n".
"DTSTAMP:" . date('Ymd\THis', time()) . "\n".
"LOCATION:$address\n".
"DESCRIPTION:" . $this->escapeString($description) . "\n".
"URL;VALUE=URI:http://www.domain.com/events-" . $row2["EVENT_ID"] . "\n".
"SUMMARY:" . $this->escapeString($title) . "\n".
"END:VEVENT\n";
It works for the first event so I don't think it's a problem with the code that's generated for each event, I have done a little researching but I can't seem to find a solution, is there an extra statement that needs to be used between each event?
Or perhaps outlook does not support multiple events in a single iCal and therefore only imports the first one?
any help or suggestions would be greatly appreciated.
Thanks in advance.