【发布时间】:2021-02-24 05:56:23
【问题描述】:
我正在使用 php mailer 向收件人发送邮件,我需要发送日历事件,我知道如何将它们作为附件发送,但我想在邮件正文中发送它们。有可能吗?
$message = "You have been invited to the online meeting '".$schedule->schedule_name.
"', On ".$date." (".$start_time."-".$end_time.") by Tuti.World \n
(See attachments for more details)";
$ical_content = "BEGIN:VCALENDAR
VERSION:2.0
PRODID://Drupal iCal API//EN
BEGIN:VEVENT
UID:http://www.icalmaker.com/event/d8fefcc9-a576-4432-8b20-40e90889affd
DTSTAMP:".$date.
"DTSTART:".$start_time.
"DTEND:".$end_time.
"SUMMARY:Online Meeting
END:VEVENT
END:VCALENDAR";
$mail->msgHTML($message);
$mail->addStringAttachment($ical_content,$file,'base64','text/calendar');
$mail->send();
这些是当前邮件正文和日历事件的代码块...
【问题讨论】:
-
您的意思是要将 iCal 文件与内容内联吗?我认为这是不可能的。
-
是的,我试图将 i cal 添加到正文中,如果可能的话, i cal 不需要是文件。我之前没有使用过 php mailer 或 i cal 事件,所以我不知道这些限制。
标签: php laravel email phpmailer icalendar