我想使用codeigniter 3在outlook上发送日历事件。
我有这段代码。
$organizer = 'John Doe';
$organizer_email = 'xxx@xxx.com';
$location = "Park";
$date = '20180122';
$date2 = '20180123';
$startTime = '0100';
$endTime = '0900';
$subject = 'Test';
$desc = 'Email Testing';
$headers = 'From: Peter <xxxx@xxx.com>';
$headers .= 'Content-Type:text/calendar; Content-Disposition: inline; charset=utf-8;\r\n';
$headers .= "Content-Type: text/plain;charset=\"utf-8\"\r\n";
$message = "BEGIN:VCALENDAR\r\n
X-WR-TIMEZONE:Asia/Manila
VERSION:2.0\r\n
PRODID:-//Deathstar-mailer//theforce/NONSGML v1.0//EN\r\n
METHOD:REQUEST\r\n
BEGIN:VEVENT\r\n
UID:" . md5(uniqid(mt_rand(), true)) . "xxxx.com\r\n
DTSTAMP:" . gmdate('Ymd').'T'. gmdate('His') . "Z\r\n
DTSTART:".$date."T".$startTime."00Z\r\n
DTEND:".$date2."T".$endTime."00Z\r\n
SUMMARY:".$subject."\r\n
ORGANIZER;CN=".$organizer.":mailto:".$organizer_email."\r\n
LOCATION:".$location."\r\n
DESCRIPTION:".$desc."\r\n
".$recp."
END:VEVENT\r\n
END:VCALENDAR\r\n";
mail($toRecipients, $subject, $message, $headers);
但我收到了类似的东西
你能告诉我我做错了吗? 在此先感谢。