我正在向 Outlook 发送日期为 20131101T130000Z 和 20131101T150000Z 的事件,但该事件是 10:00:00 - 12:00:00。
我尝试在脚本中添加时区,但不能。时区是美国/福塔莱萨,距离格林威治标准时间不到 3 小时。
还有另一个错误。它是一个不发送到事件的描述,它被设置并包含变量 $subject 中的信息
公共静态函数 enviaReunio($dtstart,$dtend,$loc,$summary,$from,$to,$subject, $project) { $vcal = "开始:VCALENDAR\r\n"; $vcal .= "版本:2.0\r\n"; $vcal .= "PRODID:-//Esmaltec\r\n"; $vcal .= "方法:请求\r\n"; $vcal .= "BEGIN:VEVENT\r\n"; $vcal .= "ATTENDEE;CN=\"Sistemas 3\";ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:leandror@intranet.esmaltec.com.br\r\n"; $vcal .= "ATTENDEE;CN=\"Leandro Pedrosa\";ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:leandror@intranet.esmaltec.com.br\r\n"; $vcal .= "UID:".date('Ymd').'T'.date('His')."-".rand()."-esmaltec.com.br\r\n"; $vcal .= "DTSTAMP:".date('Ymd').'T'.date('His')."\r\n"; $vcal .= "DTSTART:$dtstart\r\n"; $vcal .= "DTEND:$dtend\r\n"; if ($loc != "") $vcal .= "位置:$loc\r\n"; $vcal .= "SUMMARY:$summary\r\n"; $vcal .= "组织者; CN=\"EPROJ - $project\":mailto:leandror@intranet.esmaltec.com.br\n"; $vcal .= "序列:0\r\n"; $vcal .= "BEGIN:VALARM\r\n"; $vcal .= "触发:-PT15M\r\n"; $vcal .= "动作:显示\r\n"; $vcal .= "描述:$subject\r\n"; $vcal .= "END:VALARM\r\n"; $vcal .= "END:VEVENT\r\n"; $vcal .= "END:VCALENDAR\r\n";//echo $vcal; //iso-8859-1 $headers = "From: $from\r\nReply-To: $from"; $headers .= "\r\nMIME-version: 1.0\r\nContent-Type: text/calendar; method=REQUEST; charset=\"utf-8\""; $headers .= "\r\nContent-Transfer-Encoding: 7bit\r\nX-Mailer: Microsoft Office Outlook 12.0"; if(mail($to, $summary, $vcal, $headers)) { return true; } else { return false; } }
这个例子:
enviaReuniao ("20131101T130000Z", "20131101T150000Z", "Location", "Title", "example@example.com", "example1@example.com", "Description", "Project 1");