PHP - 预约Outlook或Mac日历

时间:2012-09-01 06:02:18

标签: php calendar

我只是想知道并搜索互联网。是否可以通过邮件创建约会并将其作为附件发送,以便您可以将其保存在日历客户端上。

是否可以在PHP中使用?如果是这样,有人可以给我一个例子或教程吗?

提前致谢

1 个答案:

答案 0 :(得分:0)

header("Content-Type: text/Calendar");
header("Content-Disposition: inline; filename=calendar.ics");
echo "BEGIN:VCALENDAR\n";
echo "VERSION:2.0\n";
echo "PRODID:-//Foobar Corporation//NONSGML Foobar//EN\n";
echo "METHOD:REQUEST\n"; // requied by Outlook
echo "BEGIN:VEVENT\n";
echo "UID:".date('Ymd').'T'.date('His')."-".rand()."-example.com\n"; // required by Outlok
echo "DTSTAMP:".date('Ymd').'T'.date('His')."\n"; // required by Outlook
echo "DTSTART:20080413T000000\n"; 
echo "SUMMARY:TEST\n";
echo "DESCRIPTION: this is just a test\n";
echo "END:VEVENT\n";
echo "END:VCALENDAR\n";

http://www.terminally-incoherent.com/blog/2008/04/14/generate-outlook-calendar-events-with-php-and-icalendar/

您可以使用get变量替换信息以生成动态链接。