return to I Love My Journal
A Little Closer to Center...
Musings about Life, Linux, and Latter-day Saints.
Pages
About Me
Links


Tags
PERSONAL 520
SPIRITUAL 416
LDS 312
BOOK OF MORMON 237
SCRIPTURES 154
STUDIO-JOURNEY 129
RELIGION 112
LINUX 79
COMPUTERS 65
LIFE 60
GENERAL CONFERENCE 46
GENTOO 39
MISCELLANEOUS 37
MUSIC 37
PROGRAMMING 33
CARS 29
MICROSOFT 23
FAMILY 23
AUDIO 21
I LOVE MY JOURNAL 18
FUN 15
CHILDREN 12
CURRENT EVENTS 10
NATURE'S WAY 10
VIDEO 9
DRM 9
CONEXM 7
BABBLINGS 7
PROVO CITY CENTER TEMPLE 6
FRIENDS 6
HEROD THE FINK 5
GAMES 5
COMPUTER HARDWARE 5
DRUMS 4
HAND OF GOD 3
ADVERSITY 3
KDENLIVE 3
AUDIO HARDWARE 3
GENERAL INSANITY 3
STUDIO 3
THANKS4GIVING 2
CATS 2
MY JOURNAL 1
POETRY 1
FOREVERGREEN 1
EVERYDAY THOUGHTS 1
GOSPEL 1
PARENTING 1
YOUTH CONFERENCE 1
CHURCH NOTES 1
POLITICS 1


RSS Feed

RSS FeedSubscribe!
Tue - Mar 17, 2009 : 02:46 pm
happy
   rated 23 times
>>next>>
<<previous<<
Outlook Calendar Events in PHP
Man, the weather's getting nice out there...  Makes me not want to program.  Yet, here I am.

Today I had the task of somehow getting a PHP-generated web app to generate an Outlook appointment based on database information, and have it work.

Turns out that 2 hours later, I have it functioning perfectly, thanks, in large part to this blog entry. (Thanks Luke!)

So, in case you didn't want to read his entry, I'll post basically the same code snippet here as he did there, without the detailed explanation.

<?php
//SET THE TIMEZONE
$success = date_default_timezone_set("America/Denver");
header("Content-Type: text/Calendar");
header("Content-Disposition: inline; filename=calendar.ics");
echo "BEGIN:VCALENDAR\n";
echo "VERSION:2.0\n";
echo "PRODID:-//Generated by PHP in Linux!//NONSGML Linux Rocks//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:$_GET[date]\n";
echo "SUMMARY:Visit with $_GET[contact]\n";
echo "DESCRIPTION: Visit with $_GET[contact] at $_GET[customer]\n";
echo "END:VEVENT\n";
echo "END:VCALENDAR\n";
?>

You'll, of course, want to get rid of the GET variable crud, but other than that, I have verified that this works with Outlook 2003.  In outlook 2007, it comes as an event, but not an appointment.  I'll have to figure that out later.

So...  Happy code pirating.  (worked for me!)
Comment by shashi on May. 18, 2011 @ 06:53 am
Hi, i would like to know how can i automate the process of adding the event to outlook when i run this code, instead of saving the generated ics file manually to outlook.
Comment by kripa on Jul. 04, 2011 @ 06:07 am
Test Outlook Event Invitation
Comment by priya on Jan. 19, 2012 @ 02:15 am
 Hi,




This is a simple outlook calendar invitation using php, but it has some constraints like




1) You cannot view the participant's availability

2) No calendar updates are trigerred only  a new invitation can be sent.

So if you find any outlook API or integration with PHP, then do advise.
Comment by ameth on Jul. 04, 2012 @ 02:02 pm
dsdsds