有人能指出我正确的方向吗?我知道它与附加一个.ics文件有关,但我只能将它带到用户可以下载的位置,然后将事件导入到Outlook日历中。我如何以编程方式创建这些会议要求?如何在PHP中创建Outlook日历会议请求?
11
A
回答
5
您可以通过编程产生的.ics :)
方法如下:
<?php
$date = $_GET['date'];
$startTime = $_GET['startTime'];
$endTime = $_GET['endTime'];
$subject = $_GET['subject'];
$desc = $_GET['desc'];
$ical = "BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
BEGIN:VEVENT
UID:" . md5(uniqid(mt_rand(), true)) . "example.com
DTSTAMP:" . gmdate('Ymd').'T'. gmdate('His') . "Z
DTSTART:".$date."T".$startTime."00Z
DTEND:".$date."T".$endTime."00Z
SUMMARY:".$subject."
DESCRIPTION:".$desc."
END:VEVENT
END:VCALENDAR";
//set correct content-type-header
header('Content-type: text/calendar; charset=utf-8');
header('Content-Disposition: inline; filename=calendar.ics');
echo $ical;
exit;
?>
18
这里正在例如使用多个参与者:
<?php
$to = '[email protected],[email protected]';
$subject = "Millennium Falcon";
$organizer = 'Darth Vader';
$organizer_email = '[email protected]';
$participant_name_1 = 'Boushh';
$participant_email_1= '[email protected]';
$participant_name_2 = 'Boba Fett';
$participant_email_2= '[email protected]';
$location = "Stardestroyer-013";
$date = '20131026';
$startTime = '0800';
$endTime = '0900';
$subject = 'Millennium Falcon';
$desc = 'The purpose of the meeting is to discuss the capture of Millennium Falcon and its crew.';
$headers = 'Content-Type:text/calendar; Content-Disposition: inline; charset=utf-8;\r\n';
$headers .= "Content-Type: text/plain;charset=\"utf-8\"\r\n"; #EDIT: TYPO
$message = "BEGIN:VCALENDAR\r\n
VERSION:2.0\r\n
PRODID:-//Deathstar-mailer//theforce/NONSGML v1.0//EN\r\n
METHOD:REQUEST\r\n
BEGIN:VEVENT\r\n
UID:" . md5(uniqid(mt_rand(), true)) . "example.com\r\n
DTSTAMP:" . gmdate('Ymd').'T'. gmdate('His') . "Z\r\n
DTSTART:".$date."T".$startTime."00Z\r\n
DTEND:".$date."T".$endTime."00Z\r\n
SUMMARY:".$subject."\r\n
ORGANIZER;CN=".$organizer.":mailto:".$organizer_email."\r\n
LOCATION:".$location."\r\n
DESCRIPTION:".$desc."\r\n
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN".$participant_name_1.";X-NUM-GUESTS=0:MAILTO:".$participant_email_1."\r\n
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN".$participant_name_2.";X-NUM-GUESTS=0:MAILTO:".$participant_email_2."\r\n
END:VEVENT\r\n
END:VCALENDAR\r\n";
$headers .= $message;
mail($to, $subject, $message, $headers);
?>
这里我发表的是如何将看起来像在Outlook和Gmail图片: Examples
如果您需要添加/去除这里的选项是VCALENDAR的参考: VCALENDAR on Wikipedia
相关问题
- 1. 是否可以使用nodeJS创建Outlook的会议请求?
- 2. Excel创建Outlook会议请求,无法发送
- 3. JAVA创建的ical会议在接受时不显示在Outlook日历中
- 4. 会议在PHP Ajax请求
- 5. 如何使用替代发件人/组织者创建Outlook会议请求?
- 6. Outlook日历Rest API(使用更改管理器创建使用/ me/events请求的会议)
- 7. Outlook如何创建任务请求?
- 8. 在Azure中使用SendGrid创建Outlook日历邀请(C#,.NET)
- 9. 使用苹果脚本在Outlook 2011中创建会议邀请
- 10. 发送MS Outlook的会议请求
- 11. 在PHP中创建日历
- 12. 如何创建并向Microsoft Outlook日历发送约会?
- 13. 如何在Excel中使用VBA代表其他日历发送会议请求?
- 14. 如何在PHP中创建HTTP请求?
- 15. 在没有Outlook的情况下发送Outlook会议请求?
- 16. 如何在Outlook 2007中使用C#进行会议(在日历中)?
- 17. 如何在Outlook中创建日历组文件夹?
- 18. 如何在laravel中创建Outlook日历事件?
- 19. 如何在java中创建outlook任务请求
- 20. 在MVC3中获取Outlook会议请求更新
- 21. 使用POST请求在Google日历中创建新事件
- 22. 无法创建Outlook日历事件
- 23. Excel创建一个Outlook日历事件
- 24. 在线会议日历
- 25. 共享日历中的自定义Outlook会议通知表格
- 26. PHP会议建议需要请
- 27. 在PHP中创建自定义日历
- 28. 与outlook同步php日历
- 29. 如何更新ICS日历会议?
- 30. 从ASP.NET创建Outlook任务请求
荣誉保持主题与去你的用户名和个人资料图片 – ScottC