php - ical event showing up in outlook email as "not supported calendar message.ics" -
we upgraded our php server 5.3.3 lower version. before this, had program sent out calendar event accepted or declined receiver of email. after upgrade email gives event attachment no ability accept event. shows attachment "not supported calendar message.ics."
i have included code has worked couple of years. great.
if ($dept) { while ($deptrow = mysql_fetch_assoc($dept)) { //$attendees .= "\r\nattendee; cn=".$deptrow['emp_name'].";role=req-participant;rsvp=false:mailto:".$deptrow['emp_email']; $attendees .= "\r\nattendee; cn=organizer;role=req-participant;rsvp=false:mailto:organizer@email.com"; //$email .= ",".$deptrow['emp_email']; $email .= ",email@email.com"; } } $from_name = $supname; $from_address = $supemail; $subject = $toname." - a/l"; //doubles email subject , meeting subject in calendar //create mime boundry $mime_boundary = "----meeting booking----".md5(time()); //create email headers $headers = "from: ".$from_name." <".$from_address.">\n"; $headers .= "reply-to: ".$from_name." <".$from_address.">\n"; $headers .= "mime-version: 1.0\n"; $headers .= "content-type: multipart/alternative; boundary=\"$mime_boundary\"\n"; $headers .= "content-class: urn:content-classes:calendarmessage\n"; //create email body (html) $message = "--$mime_boundary\n"; $message .= "content-type: text/html; charset=utf-8\n"; $message .= "content-transfer-encoding: 8bit\n\n"; $message .= "<html>\n"; $message .= "<body>\n"; $message .= '<p>'.$toname.',</p>'; $message .= "<p>has been <b>".$status."</b> following annual leave:"; $message .= "<br /><br />start date: <b>".date('m j/y',$startdate)."</b>"; $message .= "<br />end date: <b>".date('m j/y',$enddate)."</b>"; $message .= "<br /><br />the request consists of <b>".$reqal."</b> days of a/l , <b>".$reqcomp."</b> hours of comp. time. please accept add calendar.</p>"; $message .= "</body>\n"; $message .= "</html>\n"; $message .= "--$mime_boundary\n"; $ical = 'begin:vcalendar version:2.0 prodid:-//microsoft corporation//outlook 11.0 mimedir//en method:request begin:vtimezone tzid:america/edmonton begin:standard dtstart:16011104t020000 rrule:freq=yearly;byday=1su;bymonth=11 tzoffsetfrom:-0600 tzoffsetto:-0700 end:standard begin:daylight dtstart:16010311t020000 rrule:freq=yearly;byday=2su;bymonth=3 tzoffsetfrom:-0700 tzoffsetto:-0600 end:daylight end:vtimezone begin:vevent '.$attendees.' uid:'.date('ymd').'t'.date('his')."-".rand()."@superchannel.ca".' dtstamp:'.date("ymd\this").' dtstart:'.date('ymd',$startdate).'t'.date('his',$startdate).' dtend:'.date('ymd',$enddate).'t'.date('his',($enddate+86399)).' location:annual leave transp:transparent sequence:0 description:'.$reqal.' days of a/l , '.$reqcomp.' hours of comp time. summary:'.$subject.' priority:5 status:confirmed class:public end:vevent end:vcalendar'; $message .= "content-type: text/calendar;name=\"meeting.ics\";method=request\n;component=\"vevent\";"; $message .= "content-transfer-encoding: 8bit\n\n"; $message .= "content-transfer-encoding: quoted-printable\n\n"; $message .= $ical; print_r($ical); //send mail $mail_sent = @mail( $email, $subject, $message, $headers );
Comments
Post a Comment