使用php脚本将事件添加到Outlook日历 [英] Add events to outlook calendar with php script

查看:458
本文介绍了使用php脚本将事件添加到Outlook日历的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想从php代码添加事件到我的Outlook日历。由于外观可以接受一个扩展名为.ics的文件,我已经尝试了此示例代码来生成ics文件:

I want to add events to my outlook calendar from the php code. As outlook can accept a file of extension ".ics", I have tried this sample code to generate an ics file:

<?php
header("Content-Type: text/Calendar");
header("Content-Disposition: inline; filename=calendar.ics");
echo "BEGIN:VCALENDAR\n";
echo "VERSION:2.0\n";
echo "PRODID:www.testMeiCalendar.net\n";
echo "METHOD:REQUEST\n"; // requied by Outlook
echo "BEGIN:VEVENT\n";
echo "DTSTART:20101231T230000\n";
echo "DTEND:20110101T010000\n";
echo "SUMMARY:New Years Eve Reminder\n";
echo "LOCATION:Downtown\n";
echo "DESCRIPTION:Let's get together for New Years Eve\n";
echo "UID:ABCD1234\n";
echo "SEQUENCE:0\n";
echo "DTSTAMP:20101125T112600\n";
echo "END:VEVENT\n";
echo "END:VCALENDAR\n";
?>

所以现在,当我在Firefox中运行这个代码时,我有一个弹出窗口要求打开生成的ics文件使用Microsoft Outlook,我打开它并将其保存到Outlook中,最后在Outlook中添加一个事件。

So now when I run this code in Firefox, I got a pop-up asking to open the generated ics file using the Microsoft Outlook and I opened it and saved it to outlook and finally an event is added in outlook.

但是有一种方法可以自动执行此过程?我的意思是,我可以直接从PHP脚本将事件存储在Outlook日历中,而不需要生成ics文件并保存它?

But is there a way I can automate this process? I mean, can I store the event in Outlook calendar directly from a php script, without needing to generate an ics file and saving it?

推荐答案

您的服务器应用程序应如何访问客户端应用程序?您可以使用日历条目向您的客户发送电子邮件。也许这对您的用户来说稍微舒服一些。

How your server application should be able to access a client application? You may send an email to your client with a calendar entry. Maybe this is slightly more comfortable for your user.

这篇关于使用php脚本将事件添加到Outlook日历的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆