When the outlook calendar attachment is sent with the email, it does not appear on the outlook calendar. Even after opening the attachment it does not put itself on the calendar. it's working fine in Gmail but attachment problem occurs in Microsoft outlook.
here i have given code below:
$msg_email.="BEGIN:VCALENDAR\n";
$msg_email.="VERSION:2.0\n";
$msg_email.="PRODID:-//$id//NONSGML $id//EN\n";
$msg_email.="METHOD:REQUEST\n"; // requied by Outlook
$msg_email.="BEGIN:VTIMEZONE\n";
$msg_email.="TZID:$timezone\n";
$msg_email.="X-LIC-LOCATION:$timezone\n";
$msg_email.="BEGIN:DAYLIGHT\n";
$msg_email.="TZOFFSETFROM:+1000\n";
$msg_email.="TZOFFSETTO:+1100\n";
$msg_email.="TZNAME:EST\n";
$msg_email.="DTSTART:19701025T020000\n";
$msg_email.="RRULE:FREQ=YEARLY;BYMONTH=10;BYDAY=-1SU\n";
$msg_email.="END:DAYLIGHT\n";
$msg_email.="BEGIN:STANDARD\n";
$msg_email.="TZOFFSETFROM:+1000\n";
$msg_email.="TZOFFSETTO:+1000\n";
$msg_email.="TZNAME:EST\n";
$msg_email.="DTSTART:19700329T020000\n";
$msg_email.="RRULE:FREQ=YEARLY;BYMONTH=3;BYDAY=-1SU\n";
$msg_email.="END:STANDARD\n";
$msg_email.="END:VTIMEZONE\n";
$msg_email.="BEGIN:VEVENT\n";
$msg_email.="UID:".date('Ymd').'T'.date('His')."-".rand()."-".$b_id."\n";
$msg_email.="DTSTAMP:".date('Ymd').'T'.date('His')."\n"; // required by Outlook
//$msg_email.="DTSTART:".date('Ymd', $starttime).'T'.date('His', $starttime)."\n";
$msg_email.="DTSTART1:".date("Ymd", $starttime)."T".date("His", $starttime)."\n";
$msg_email.="DTEND1:".date('Ymd', $endtime).'T'.date('His', $endtime)."\n";
$msg_email.="SUMMARY:".$mrbs_company." Booking\n";
$msg_email.="END:VEVENT\n";
$msg_email.="END:VCALENDAR\n";
$msg_email = str_replace("DTSTART1","DTSTART;TZID=\"$timezone\"",$msg_email);
$msg_email = str_replace("DTEND1","DTEND;TZID=\"$timezone\"",$msg_email);
$ics_msg="--MIME_BOUNDRY\n";
$ics_msg.="Content-Type: text/Calendar; name=".$myFile."\n";
$ics_msg.="Content-disposition: attachment; filename=".$myFile."\n";
$ics_msg.="Content-Transfer-Encoding: base64\n";
$ics_msg.="\n";
$ics_msg.=$msg_email."\n\n";