php-将事件发送到日历为闲暇时间
我有一个PHP代码,该代码生成并发送Outlook事件。但是它将用户状态设置为忙碌,我们不想要那个。我知道我可以将事件发送给某人,并将状态设置为该事件的空闲时间。但是我不知道,如何在我的代码中做到这一点。所以我的问题是,我需要更改哪个参数,以将事件状态设置为空闲时间?
代码 :
$ical = 'BEGIN:VCALENDAR' . "\r\n" .
'PRODID:-//Microsoft Corporation//Outlook 10.0 MIMEDIR//EN' . "\r\n" .
'VERSION:2.0' . "\r\n" .
'METHOD:REQUEST' . "\r\n" .
'BEGIN:VTIMEZONE' . "\r\n" .
'TZID:Central Europe Standard Time' . "\r\n" .
'BEGIN:STANDARD' . "\r\n" .
'DTSTART:16011028T030000' . "\r\n" .
'RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=10' . "\r\n" .
'TZOFFSETFROM:+0200' . "\r\n" .
'TZOFFSETTO:+0100' . "\r\n" .
'END:STANDARD' . "\r\n" .
'BEGIN:DAYLIGHT' . "\r\n" .
'DTSTART:16010325T020000' . "\r\n" .
'RRULE:FREQ=YEARLY;BYDAY=-1SU;BYMONTH=3' . "\r\n" .
'TZOFFSETFROM:+0100' . "\r\n" .
'TZOFFSETTO:+0200' . "\r\n" .
'END:DAYLIGHT' . "\r\n" .
'END:VTIMEZONE ' . "\r\n" .
'BEGIN:VEVENT' . "\r\n" .
'ORGANIZER;CN="'.$name.'":MAILTO:'.$name. "\r\n" .
'ATTENDEE;CN="'.$name.'";ROLE=REQ-PARTICIPANT;RSVP=TRUE:MAILTO:'.$name.','.$address.','.$address2.' ,'.$address3. "\r\n" .
'LAST-MODIFIED:' . date("Ymd\TGis") . "\r\n" .
'UID:'.date("Ymd\TGis", strtotime($startTime)).rand()."@".$domain."\r\n" .
'DTSTAMP:'.date("Ymd\TGis"). "\r\n" .
'DTSTART;TZID="Central Europe Standard Time":'.date("Ymd\THis", strtotime($startTime)). "\r\n" .
'DTEND;TZID="Central Europe Standard Time":'.date("Ymd\THis", strtotime($endTime)). "\r\n" .
'TRANSP:OPAQUE'. "\r\n" .
'SEQUENCE:1'. "\r\n" .
'SUMMARY:' . $subject . "\r\n" .
'CLASS:PUBLIC'. "\r\n" .
'PRIORITY:5'. "\r\n" .
'BEGIN:VALARM' . "\r\n" .
'TRIGGER:-PT15M' . "\r\n" .
'ACTION:DISPLAY' . "\r\n" .
'DESCRIPTION:Reminder' . "\r\n" .
'END:VALARM' . "\r\n" .
'END:VEVENT'. "\r\n" .
'END:VCALENDAR'. "\r\n";
$mail->Subject = "Invitation: Outlook Calendar Event";
$mail->AddStringAttachment($ical, "event.ics", "7bit", "text/calendar; charset=utf-8; method=REQUEST");
$mail->Body = "Test Outlook Calendar event mail";
$mail->Ical = $ical;
$mail->CharSet = 'UTF-8';
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
只需在适当的日期和时间中添加此行:
例如:
freeBusy; fbtype =忙:19980415T133000Z/19980415T170000Z
or,如果是for Outlook:
sources:sources:source:
Just add this line in your ical with the right date and time :
e.g. :
FREEBUSY;FBTYPE=BUSY:19980415T133000Z/19980415T170000Z
Or, if it's for Outlook :
sources :