2009-11-02 64 views
9

任何人都知道我可以如何將錨點添加到將強制Outlook日曆文件下載的網頁?我需要使用outlook打開文件並將日曆信息添加到用戶的日曆中。從網頁上的鏈接添加Outlook日曆事件

如何創建MS Outlook日曆文件?有沒有一種標準/文件化的方式,我可以使用腳本/自動方式創建這些日曆文件? (該腳本將在PHP寫)

感謝 -

回答

9

創建Outlook .ics文件

更多信息請參見here。這個例子是在.NET中,但它只是寫輸出,所以很容易翻譯成PHP。

14
<?php 
//This is the most important coding. 
header("Content-Type: text/Calendar"); 
header("Content-Disposition: inline; filename=filename.ics"); 
echo "BEGIN:VCALENDAR\n"; 
echo "PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//EN\n"; 
echo "VERSION:2.0\n"; 
echo "METHOD:PUBLISH\n"; 
echo "X-MS-OLK-FORCEINSPECTOROPEN:TRUE\n"; 
echo "BEGIN:VEVENT\n"; 
echo "CLASS:PUBLIC\n"; 
echo "CREATED:20091109T101015Z\n"; 
echo "DESCRIPTION:How 2 Guru Event\\n\\n\\nEvent Page\\n\\nhttp://www.myhow2guru.com\n"; 
echo "DTEND:20091208T040000Z\n"; 
echo "DTSTAMP:20091109T093305Z\n"; 
echo "DTSTART:20091208T003000Z\n"; 
echo "LAST-MODIFIED:20091109T101015Z\n"; 
echo "LOCATION:Anywhere have internet\n"; 
echo "PRIORITY:5\n"; 
echo "SEQUENCE:0\n"; 
echo "SUMMARY;LANGUAGE=en-us:How2Guru Event\n"; 
echo "TRANSP:OPAQUE\n"; 
echo "UID:040000008200E00074C5B7101A82E008000000008062306C6261CA01000000000000000\n"; 
echo "X-MICROSOFT-CDO-BUSYSTATUS:BUSY\n"; 
echo "X-MICROSOFT-CDO-IMPORTANCE:1\n"; 
echo "X-MICROSOFT-DISALLOW-COUNTER:FALSE\n"; 
echo "X-MS-OLK-ALLOWEXTERNCHECK:TRUE\n"; 
echo "X-MS-OLK-AUTOFILLLOCATION:FALSE\n"; 
echo "X-MS-OLK-CONFTYPE:0\n"; 
//Here is to set the reminder for the event. 
echo "BEGIN:VALARM\n"; 
echo "TRIGGER:-PT1440M\n"; 
echo "ACTION:DISPLAY\n"; 
echo "DESCRIPTION:Reminder\n"; 
echo "END:VALARM\n"; 
echo "END:VEVENT\n"; 
echo "END:VCALENDAR\n"; 
?> 

以防萬一有人需要它在PHP中。我正在尋找這個。

+0

這太棒了! – karancan 2013-01-23 17:14:39

相關問題