您好我想用电子邮件实现ics附件。我试过下面的代码,但它没有用。
$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";
$email = new SendGrid\Email();
$email->addTo($email_to)
->setFrom($email_from)
->setFromName($email_from_name)
->setReplyTo($email_reply)
->setSubject($email_subject)
->setHtml($email_message)
->setAttachment($ical);