2012-09-01 89 views
0

我只是想知道和搜索互聯網。是否可以通過郵件創建預約並將其作爲附件發送,以便將其保存到日曆客戶端。PHP - 讓Outlook或Mac日曆預約

在PHP中可以嗎?如果是這樣,任何人都可以給我一個例子或教程?

在此先感謝

回答

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變量的信息來進行動態鏈接。

+0

它不適用於Mac嗎? – Naeem