dongwen4487 2010-12-13 08:24
浏览 181
已采纳

是否存在Icalendar事件RSVP的标准和实现

The summary is that I am now implementing an event confirmation system and can't find the right format for the ICalendar replies. Therefore I wonder if there is an example out there of complete REPLY message and maybe a PHP library that would wrap it all?

Now for the details, we get external emails including event invitations asking for RSVP. Here is an excerpt of the iCal file:

ATTENDEE;ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE;CN="'user@company.com'":MAILTO:user@company.com ORGANIZER;CN="Organ Izer":MAILTO:organizer@company.com

I couldn't find the reply standard to send the RSVP to the organizer. The RFC 2447 mentions "ATTSTAT" and "PARTSTAT" parameter.

By trying to mail the following message to Google calendar the event is not being updated.

$headers = "Content-Type:text/calendar; Content-Disposition: inline; charset=utf-8;
";
$headers .= "Content-Type: text/plain;charset=\"utf-8\"
";
$headers .= 'BEGIN:VCALENDAR
VERSION:2.0
METHOD:REPLY
BEGIN:VEVENT
ORGANIZER;CN=JCharles:mailto:abcdef@gmail.com
UID:oc7ae7537999onscsivg8km123@google.com
ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=CONFIRMED;RSVP=
 TRUE;CN=jc@company.se;X-NUM-GUESTS=0:mailto:jc@company.se
LOCATION:
SEQUENCE:1
END:VEVENT
END:VCALENDAR';

mail('abcdef@gmail.com', 'Accepted:', "Event accepted", $headers);

Is there anything wrong with the Ical message or with the method in itself? Is this the way the event replies are supposed to be sent?

展开全部

  • 写回答

2条回答 默认 最新

  • duanshan1511 2010-12-14 02:34
    关注

    The following code will work with google calendar. The attachment is processed by gmail and acceptance is cascaded to the event.

    $vcal = 'BEGIN:VCALENDAR
    PRODID:-//EXAMPLE.NU//SE
    VERSION:2.0
    CALSCALE:GREGORIAN
    METHOD:REPLY
    BEGIN:VEVENT
    DTSTART:20101215T160000Z
    DTEND:20101215T170000Z
    DTSTAMP:'.date('Ymd\THis\Z').'
    ORGANIZER;CN=Jean-Charles:mailto:example@gmail.com
    UID:u2coh5g3bppo2d2o3t@google.com
    ATTENDEE;CUTYPE=INDIVIDUAL;ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;
     CN=user@example.se:mailto:user@example.se
    CREATED:19000101T120000Z
    DESCRIPTION:äåóö
    LAST-MODIFIED:'.date('Ymd\THis\Z').'
    LOCATION:
    SEQUENCE:0
    STATUS:CONFIRMED
    SUMMARY:a new test
    TRANSP:OPAQUE
    END:VEVENT
    END:VCALENDAR
    ';
    
    $vcal = utf8_encode($vcal);
    
    require('lib/phpmailer/class.phpmailer.php');
    $mail = new PHPMailer();
    $mail->AddAddress('example@gmail.com', 'Jean-Charles');
    $mail->Body = "HTML BODY";
    $mail->AltBody = "Text body";
    $mail->Subject = "Email title";
    $mail->Sender = "User Name";
    $mail->FromName = "user@example.se";
    $mail->AddStringAttachment($vcal, 'meeting.ics', "base64", "text/calendar");
    $mail->Send();
    

    The important bits are

    • Content-type : text/calendar
    • METHOD:REPLY
    • PARTSTAT:ACCEPTED|DECLINED
    • UID

    I am not sure that it is necessary to send back all redundant information (description, summary, dtend, dtstart)

    展开全部

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)
编辑
预览

报告相同问题?

悬赏问题

  • ¥15 优博讯dt50巴枪怎么提取镜像
  • ¥30 在CodBlock上用c++语言运行
  • ¥15 求C6748 IIC EEPROM程序固化烧写算法
  • ¥50 关于#php#的问题,请各位专家解答!
  • ¥15 python 3.8.0版本,安装官方库ibm_db遇到问题,提示找不到ibm_db模块。如何解决?
  • ¥15 TMUXHS4412如何防止静电,
  • ¥30 Metashape软件中如何将建模后的图像中的植被与庄稼点云删除
  • ¥20 机械振动学课后习题求解答
  • ¥15 IEC61850 客户端和服务端的通讯机制
  • ¥15 MAX98357a(关键词-播放音频)
手机看
程序员都在用的中文IT技术交流社区

程序员都在用的中文IT技术交流社区

专业的中文 IT 技术社区,与千万技术人共成长

专业的中文 IT 技术社区,与千万技术人共成长

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

关注【CSDN】视频号,行业资讯、技术分享精彩不断,直播好礼送不停!

客服 返回
顶部