New to Calendar script, Below is my iCalendar script which is valid when checked in Icalendar and Gmail app perfectly detects it.But issue is with Outlook and apple default mail app where it will render as HTML in the mail body.
The script is generated in CakePHP 2.X and sent as an email.
$message = "BEGIN:VCALENDAR
";
$message .= "PRODID:-//My//Prod MIMEDIR//EN
";
$message .= "VERSION:2.0
";
$message .= "METHOD:PUBLISH
";
$message .= "BEGIN:VEVENT
";
$message .= 'ORGANIZER;CN="Test":test@example.com'."
";
$message .= "UID:20190530T180000-456543
";
$message .= "DTEND:20190530T190000Z
";
$message .= "DTSTAMP:".date('Ymd').'T'.date("His")."
";
$message .= "DTSTART:20190530T180000Z
";
$message .= "SUMMARY;LANGUAGE=en-us:Event Description
";
$message .= "DESCRIPTION:Test DESCRIPTION
";
$message .= "END:VEVENT
";
$message .= "END:VCALENDAR
";
$Email = new CakeEmail();
$Email->from(INFO_EMAIL)
->to('test@outlook.com')
->setHeaders(array("Content-Type" => "text/calendar; method=PUBLISH; charset=UTF-8","Content-Disposition" => "inline; filename=filename.ics"))
->subject('Subject')
->send($message);
echo "Script";
exit;
Apologies, please redirect me if the question is repeated. Any help here will be appreciated.