【发布时间】:2018-03-18 01:40:24
【问题描述】:
我想将日历邀请发送到电子邮件中。我尝试使用以下代码发送 ical 邀请,但它不起作用。
我正在使用 codeigniter Email Libraray 发送电子邮件。
创建如下所示的 ical 请求
$ical = "BEGIN:VCALENDAR
VERSION:2.0
PRODID:-//hacksw/handcal//NONSGML v1.0//EN
BEGIN:VEVENT
UID:" . md5(uniqid(mt_rand(), true)) . "@test.com
DTSTAMP:" . gmdate('Ymd').'T'. gmdate('His') . "Z
DTSTART:19970714T170000Z
DTEND:19970715T035959Z
SUMMARY:New event
END:VEVENT
END:VCALENDAR";
然后我将此内容添加到:
$this->email->set_header('Content-type', 'text/calendar');
$this->email->attach($ical);
但它不起作用。我错过了什么或做错了什么,请建议我。
【问题讨论】:
-
您是否验证了您的 ical?你可以这样做,例如icalendar.org/validator.html 和许多其他人
-
我验证它是否正确.....在发送 ical 下载选项之后,但我如何显示我在问题中提到的内容(如上图)
标签: php codeigniter email icalendar