Amit Dhamu

Writes Code

Outlook Calendar Event

<a href="AddCalendarEvent.php">Add Calendar Event</a>


<?php
    // AddCalendarEvent.php
    $title = "Event Title";
    $location = "Event Location";
    $desc = "Event Description";
    $today = date("Ymd")."T".date("His")."Z";
    $start_date = "20121225T;
    $start_time = "090000Z";
    $end_date = "20121226T";
    $end_time = "170000Z";

    header("Content-Type: text/calendar");
    header("Content-Disposition:inline; filename=$title.ics");
    header('Content-Transfer-Encoding: binary'); 
    echo "BEGIN:VCALENDARn";
    echo "PRODID:-//Microsoft Corporation//Outlook 12.0 MIMEDIR//ENn";
    echo "VERSION:2.0n";
    echo "METHOD:PUBLISHn";
    echo "X-MS-OLK-FORCEINSPECTOROPEN:TRUEn";
    echo "BEGIN:VEVENTn";
    echo "CLASS:PUBLICn";
    echo "CREATED:$todayn";
    echo "DESCRIPTION:$titlen$descriptionn";
    echo "DTEND:".$end_date.$end_time."n";
    echo "DTSTAMP:$todayn";
    echo "DTSTART:".$start_date.$start_time."n";
    echo "LAST-MODIFIED:$todayn";
    echo "LOCATION:$locationn";
    echo "PRIORITY:5n";
    echo "SEQUENCE:0n";
    echo "SUMMARY;LANGUAGE=en-us:$titlen";
    echo "TRANSP:OPAQUEn";
    echo "UID:040000008200E00074C5B7101A82E008000000008062306C6261CA01000000000000000n";
    echo "X-MICROSOFT-CDO-BUSYSTATUS:BUSYn";
    echo "X-MICROSOFT-CDO-IMPORTANCE:1n";
    echo "X-MICROSOFT-DISALLOW-COUNTER:FALSEn";
    echo "X-MS-OLK-ALLOWEXTERNCHECK:TRUEn";
    echo "X-MS-OLK-AUTOFILLLOCATION:FALSEn";
    echo "X-MS-OLK-CONFTYPE:0n";
    echo "BEGIN:VALARMn";
    echo "TRIGGER:-PT1440Mn";
    echo "ACTION:DISPLAYn";
    echo "DESCRIPTION:Remindern";
    echo "END:VALARMn";
    echo "END:VEVENTn";
    echo "END:VCALENDARn";
?>


outlook / microsoft / ics / php

← Full Screen Background Image HTML5 Desktop Notifications →