Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 5 of 5
  1. #1
    Regular Coder
    Join Date
    Jul 2004
    Posts
    158
    Thanks
    4
    Thanked 0 Times in 0 Posts

    Add Event to Outlook

    We have a calendar created via PHP and MySQL. Upon clicking on an event and viewing the full details of the event, we'd like to add a link that would download that event to Microsoft Outlook. The data for the download would come from the database which we'd Query via the unique ID for the event.

    Any ideas what format or how we'd go about creating the necessary PHP code to call the database, gather the event details, put them into the necessary format to work with Outlook and export the data to a file format that Outlook would automatically open?

  • #2
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    After reading your question I too was curious about this process, so I Googled +outlook +import +event and found this:

    http://office.microsoft.com/en-us/ou...CL100626971033

    Which describes the format of a vCalendar-type file (extension .vcs). However I was not able to find a way to automatically import a vcs file into Outlook-- it seems the only way to do it is open Outlook and use the "import" utility inside the application. Perhaps there is a way to automate it, but I was not able to find it.

  • #3
    Regular Coder
    Join Date
    Jul 2004
    Posts
    158
    Thanks
    4
    Thanked 0 Times in 0 Posts
    Fumigator,

    Thanks for the response. I don't know much about the VCS format. I have seen the export to outlook calendar on a few different sites and they use the ICS format each time.

    For example, look at:

    http://www.wnymusic.com/calendar/?ac...event_id=11672

    They have an icon of a calendar next to the title of the event which is a link to a file called event_ics.php that generates the ICS file. I've contacted this website to see if they'd be willing to share their code but if anyone else has any ideas of how to do this, I'd be greatful.

    A few other examples are:

    http://www.caringonline.org/mc/commu...eventId=108516
    https://www.ischool.washington.edu/e...dar.aspx?id=80
    http://www.networkinphilly.com/

    These sites don't use PHP to do the outlook link so I'm not sure how relevent they are.

  • #4
    UE Antagonizer Fumigator's Avatar
    Join Date
    Dec 2005
    Location
    Utah, USA, Northwestern hemisphere, Earth, Solar System, Milky Way Galaxy, Alpha Quadrant
    Posts
    7,691
    Thanks
    42
    Thanked 637 Times in 625 Posts
    Looks like ics is = to vcs pretty much. Here's the file on the WNYMusic site:
    Code:
    BEGIN:VCALENDAR
    VERSION:1.0
    PRODID:Wnymusic.com Web Calendar
    TZ:-05
    CALSCALE:GREGORIAN
    METHOD:PUBLISH
    BEGIN:VEVENT
    SUMMARY:The Revenue
    LOCATION:Club Infinity
    URL;VALUE=URI:http://www.wnymusic.com/calendar.php?event_id=11672
    DESCRIPTION;ENCODING=QUOTED-PRINTABLE: Tickets available at Club Infinity Box Office (716)565-0110, Tickets.com, Tops Supermarkets.  Free Parking.  All shows are 18 and up (if under 18, must be accompanied by someone over 21).
    DTSTART:20070814T070000
    DTEND:20070814T090000
    END:VEVENT
    END:VCALENDAR
    Seems to me you can create a file in this format (fopen, fwrite), stick an ics extension on it, and there you go.

  • #5
    Senior Coder whizard's Avatar
    Join Date
    Jan 2005
    Location
    Philadelphia, PA, USA
    Posts
    1,662
    Thanks
    14
    Thanked 76 Times in 76 Posts
    PHP Tip: If you want to use short tags (<? or <?=$var) then make sure short_open_tag is set to "1". It really helps.

    Don't forget to save everyone time and mark your thread as Resolved :)

    "Also note that it is your responsibility to die() if necessary."

    DON'T USE THE MYSQL_ EXTENSION


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •