0

Vcalendar 在 Windows Outlook 中运行良好,但在 MAC Outlook 中无法运行。当我通过电子邮件收到预约时,它显示以下消息:

charset="UTF-8"
Content-Transfer-Encoding: 7bit

BEGIN:VCALENDAR
VERSION:2.0
METHOD:REQUEST
BEGIN:VEVENT
UID:UID:20120605T112338-532614004-testing
DTSTAMP:20120605T112338
DTSTART:20120605T112338
SUMMARY: Appointment testing
DESCRIPTION: Test appointment
END:VEVENT
END:VCALENDAR

这是我用于创建约会的代码:

        $myUID="UID:".date('Ymd').'T'.date('His')."-".rand()."-test".$eol; // required by Outlok
        $message="BEGIN:VCALENDAR".$eol;
        $message.="VERSION:2.0".$eol;
        //$message.="PRODID:-//Foobar Corporation//NONSGML Foobar//EN\n";
        $message.="METHOD:REQUEST".$eol; // requied by Outlook
        $message.="BEGIN:VEVENT".$eol;
        $message.="UID:".$myUID; // required by Outlok
        $message.="DTSTAMP:".date('Ymd').'T'.date('His').$eol; // required by Outlook
        $message.="DTSTART:".date('Ymd').'T'.date('His').$eol;
        $message.="SUMMARY: $attachment_subject".$eol;
        $message.="DESCRIPTION: $notes".$eol;
        $message.="END:VEVENT".$eol;
        $message.="END:VCALENDAR".$eol;     
        $headers = "From: $User <$User_Email>".$eol;
        $headers .= "MIME-Version: 1.0".$eol;
        $headers .= "Content-Type: text/calendar; method=REQUEST;".$eol;
        $headers .= 'charset="UTF-8"';
        $headers .= $eol;
        $headers .= "Content-Transfer-Encoding: 7bit";
        mail("$Email", $subject, $message, $headers)
4

1 回答 1

0

我对它进行了更多研究,并根据 MA​​C Outlook 要求修改了代码,但它仍然提供代码,而不是在电子邮件中指定为事件:

$message="BEGIN:VCALENDAR".$eol;
$message.="VERSION:2.0".$eol;
$message.="PRODID:-//Microsoft Corporation//Entourage Mac 11.0 MIMEDIR//EN\n";
$message.="METHOD:REQUEST".$eol; // requied by Outlook
$message.="BEGIN:VTIMEZONE".$eol;
$message.="TZID:Abu Dhabi, Muscat".$eol;
$message.="X-ENTOURAGE-TZID:23".$eol;
$message.="X-ENTOURAGE-CFTIMEZONE:Asia/Muscat".$eol;
$message.="BEGIN:STANDARD".$eol;
$message.="TZNAME:Standard".$eol; 
$message.="TZOFFSETFROM:+0400".$eol;
$message.="TZOFFSETTO:+0400".$eol; 
$message.="DTSTART:20090101T010000".$eol;
$message.="END:STANDARD".$eol; 
$message.="END:VTIMEZONE".$eol; 
$message.="BEGIN:VEVENT".$eol;
$message.="UID:E153D577-98BB-4EEE-8FC9-B526A7D09DD1";
$message.="X-ENTOURAGE_UUID:E153D577-98BB-4EEE-8FC9-B526A7D09DD5".$eol; 
$message.="DTSTAMP:".date('Ymd').'T'.date('His').$eol; $message.="DTSTART;TZID='Abu Dhabi, Muscat':20120610T010000".$eol;
$message.="DTEND;TZID='Abu Dhabi, Muscat':20120610T013000".$eol; 
$message.="LAST-MODIFIED:20120609T204400Z".$eol;
$message.="SUMMARY: $attachment_subject".$eol;
$message.="DESCRIPTION: $notes".$eol; 
$message.="ORGANIZER:MAILTO:testemail@testdomain.ae".$eol;
$message.="SEQUENCE:0".$eol;
$message.="ATTENDEE;ROLE=REQ-PARTICIPANT;RSVP=TRUE;CN='Test Contact';PARTSTAT=NEEDS-ACTION:MAILTO:testemail@testdomain.ae".$eol;
$message.="X-MICROSOFT-CDO-BUSYSTATUS:BUSY".$eol; 
$message.="X-MICROSOFT-CDO-ALLDAYEVENT:FALSE".$eol;
$message.="X-MICROSOFT-CDO-INSTTYPE:0".$eol; 
$message.="BEGIN:VALARM".$eol;
$message.="ACTION:DISPLAY".$eol;
$message.="DESCRIPTION:REMINDER".$eol; 
$message.="TRIGGER;RELATED=START:-PT00H15M00S".$eol; 
$message.="END:VALARM".$eol;
$message.="END:VEVENT".$eol;
$message.="END:VCALENDAR"; 
$headers = "From: $User <$User_Email>".$eol;
$headers .= "MIME-Version: 1.0".$eol;
$headers .= "Content-Type: text/calendar;method=REQUEST;".$eol;
$headers .= 'charset="UTF-8";name="meeting.ics"';
$headers .= $eol;
$headers .= "Content-Transfer-Encoding: 7bit";
于 2012-06-10T08:18:41.953 回答