.ics 邀请日历在 outlook.com 问题中不起作用
.ics invitation calendar not working in outlook.com issue
您好,我正在使用 cakephp 电子邮件发送附有 .ics 日历的电子邮件,问题是确认按钮 si 在 yahoo 和 gmail 中完美显示,但在 outlook.com 中没有。
这是 .ics 文件的示例:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//T//T//EN
METHOD:REQUEST
BEGIN:VEVENT
UID:20150830T184133-19847-domain.com
DTSTAMP:20150830T184133
DTSTART:20150812T000000Z
DTEND:20150818T000000Z
ORGANIZER;CN=myteam:MAILTO:admin@myteam.org
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=brabrick@hotmail.com:MAILTO:brabrick@hotmail.com
LOCATION:new york
SUMMARY:Madrid
BEGIN:VALARM
TRIGGER:-PT15M
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
END:VCALENDAR
这是我的 php 创建约会 .ics 文件的代码:
$vcal = "BEGIN:VCALENDAR\r\n";
$vcal .= "VERSION:2.0\r\n";
$vcal .= "PRODID:-//T//T//EN\r\n";
$vcal .= "METHOD:REQUEST\r\n";
$vcal .= "BEGIN:VEVENT\r\n";
$vcal .= "UID:".date('Ymd').'T'.date('His')."-".rand()."-domain.com\r\n";
$vcal .= "DTSTAMP:".date('Ymd').'T'.date('His')."\r\n";
$vcal .= "DTSTART:$visitedate\r\n";
$vcal .= "DTEND:$visitedate\r\n";
$vcal .= "ORGANIZER;CN=myteam:MAILTO:admin@myteam.org\r\n";//j'ai ajouté cette ligne
$vcal .= "ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=$mail[$iduser]:MAILTO:$mail[$iduser]\r\n";
//$vcal .= "DTEND:$end\r\n";
if ($loc != "") $vcal .= "LOCATION:$loc\r\n";
$vcal .= "SUMMARY:$objet\r\n";
$vcal .= "BEGIN:VALARM\r\n";
$vcal .= "TRIGGER:-PT15M\r\n";
$vcal .= "ACTION:DISPLAY\r\n";
$vcal .= "DESCRIPTION:Reminder\r\n";
$vcal .= "END:VALARM\r\n";
$vcal .= "END:VEVENT\r\n";
$vcal .= "END:VCALENDAR\r\n";
$headers = "\r\nMIME-version: 1.0\r\nContent-Type: text/calendar; method=REQUEST; charset=\"iso-8859-1\"";
$headers .= "\r\nContent-Disposition: attachment; filename=\"appointment.ics\"";
$headers .= "\r\nContent-Transfer-Encoding: 7bit\r\nX-Mailer: Microsoft Office Outlook 12.0";
$Email = new CakeEmail('smtp');
$Email->to($mail);
$Email->subject($objet);
$Email->replyTo('admin@myteam.org');
$Email->from ('admin@myteam.org');
$Email->setHeaders(array($headers));
提前致谢
您的 ics 文件看起来没问题,所以问题很可能与您的电子邮件 MIME 结构有关。看看Multipart email with text and calendar: Outlook doesn't recognize ics
您好,我正在使用 cakephp 电子邮件发送附有 .ics 日历的电子邮件,问题是确认按钮 si 在 yahoo 和 gmail 中完美显示,但在 outlook.com 中没有。 这是 .ics 文件的示例:
BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//T//T//EN
METHOD:REQUEST
BEGIN:VEVENT
UID:20150830T184133-19847-domain.com
DTSTAMP:20150830T184133
DTSTART:20150812T000000Z
DTEND:20150818T000000Z
ORGANIZER;CN=myteam:MAILTO:admin@myteam.org
ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=brabrick@hotmail.com:MAILTO:brabrick@hotmail.com
LOCATION:new york
SUMMARY:Madrid
BEGIN:VALARM
TRIGGER:-PT15M
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
END:VCALENDAR
这是我的 php 创建约会 .ics 文件的代码:
$vcal = "BEGIN:VCALENDAR\r\n";
$vcal .= "VERSION:2.0\r\n";
$vcal .= "PRODID:-//T//T//EN\r\n";
$vcal .= "METHOD:REQUEST\r\n";
$vcal .= "BEGIN:VEVENT\r\n";
$vcal .= "UID:".date('Ymd').'T'.date('His')."-".rand()."-domain.com\r\n";
$vcal .= "DTSTAMP:".date('Ymd').'T'.date('His')."\r\n";
$vcal .= "DTSTART:$visitedate\r\n";
$vcal .= "DTEND:$visitedate\r\n";
$vcal .= "ORGANIZER;CN=myteam:MAILTO:admin@myteam.org\r\n";//j'ai ajouté cette ligne
$vcal .= "ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN=$mail[$iduser]:MAILTO:$mail[$iduser]\r\n";
//$vcal .= "DTEND:$end\r\n";
if ($loc != "") $vcal .= "LOCATION:$loc\r\n";
$vcal .= "SUMMARY:$objet\r\n";
$vcal .= "BEGIN:VALARM\r\n";
$vcal .= "TRIGGER:-PT15M\r\n";
$vcal .= "ACTION:DISPLAY\r\n";
$vcal .= "DESCRIPTION:Reminder\r\n";
$vcal .= "END:VALARM\r\n";
$vcal .= "END:VEVENT\r\n";
$vcal .= "END:VCALENDAR\r\n";
$headers = "\r\nMIME-version: 1.0\r\nContent-Type: text/calendar; method=REQUEST; charset=\"iso-8859-1\"";
$headers .= "\r\nContent-Disposition: attachment; filename=\"appointment.ics\"";
$headers .= "\r\nContent-Transfer-Encoding: 7bit\r\nX-Mailer: Microsoft Office Outlook 12.0";
$Email = new CakeEmail('smtp');
$Email->to($mail);
$Email->subject($objet);
$Email->replyTo('admin@myteam.org');
$Email->from ('admin@myteam.org');
$Email->setHeaders(array($headers));
提前致谢
您的 ics 文件看起来没问题,所以问题很可能与您的电子邮件 MIME 结构有关。看看Multipart email with text and calendar: Outlook doesn't recognize ics