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 392
SPIRITUAL 321
LDS 312
BOOK OF MORMON 235
SCRIPTURES 152
RELIGION 112
LINUX 79
STUDIO-JOURNEY 72
COMPUTERS 65
LIFE 60
GENTOO 39
GENERAL CONFERENCE 39
MUSIC 37
MISCELLANEOUS 36
PROGRAMMING 33
CARS 29
FAMILY 23
MICROSOFT 23
AUDIO 21
I LOVE MY JOURNAL 18
FUN 15
CHILDREN 12
NATURE'S WAY 10
CURRENT EVENTS 10
DRM 9
VIDEO 9
CONEXM 7
BABBLINGS 7
FRIENDS 6
GAMES 5
HEROD THE FINK 5
COMPUTER HARDWARE 5
DRUMS 4
GENERAL INSANITY 3
KDENLIVE 3
STUDIO 3
AUDIO HARDWARE 3
ADVERSITY 3
CATS 2
YOUTH CONFERENCE 1
MY JOURNAL 1
GOSPEL 1
EVERYDAY THOUGHTS 1
CHURCH NOTES 1
FOREVERGREEN 1
POLITICS 1
PARENTING 1
POETRY 1


RSS Feed

RSS FeedSubscribe!
Tue - Mar 17, 2009 : 02:46 pm
happy
   rated 18 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
Let us know what you think:
Name:
Email:
Website:
Comment:


Human Test: How many wheels does a tricycle have?
Answer: