我的情况:约会存储在外部 CMS 中。我想将约会(通过 PHP/PHPMailer)发送到最终用户的邮件客户端(Outlook)。用户(组织者)应该能够将约会发送给他自己和其他与会者,而他(组织者)应该得到与会者的所有回复。
我可以将约会发送给所有用户(组织者和参加者),但如果参加者回复约会,组织者会收到通知,但组织者日历条目看不到它。他甚至没有看到“跟踪”系统来查看谁接受或拒绝了邀请。
很难描述,但希望我的问题得到澄清。
这是我的设置:
$mail = new \PHPMailer();
$mail->isSMTP();
$mail->isHTML(false);
// Settings...
$mail->ContentType = 'text/calendar';
$mail->addCustomHeader('MIME-version',"1.0");
$mail->addCustomHeader('Content-type',"text/calendar; method=REQUEST; charset=UTF-8");
$mail->addCustomHeader('Content-Transfer-Encoding',"7bit");
$mail->addCustomHeader('X-Mailer',"Microsoft Office Outlook 12.0");
$mail->addCustomHeader("Content-class: urn:content-classes:calendarmessage");
$mail->AddAddress('organizer@example.com');
$mail->AddAddress('attendent@example.com');
// Event data
$summary = 'Test event';
$location = 'Room 001';
$start = '20180310';
$start_time = '160000';
$end = '20180310';
$end_time = '163000';
$event_id = 123456;
$sequence = 0;
$status = 'CONFIRMED';
$mail->Subject = $summary";
$ical = "BEGIN:VCALENDAR\r\n";
$ical .= "VERSION:2.0\r\n";
$ical .= "PRODID:-//Company//Anything//DE\r\n";
$ical .= "METHOD:REQUEST\r\n";
$ical .= "BEGIN:VEVENT\r\n";
$ical .= ORGANIZER;CN=\"Organizer\":MAILTO:organizer@example.com\r\n";
$ical .= "ATTENDEE;CN=\"Anybody\";ROLE=REQ-PARTICIPANT;PARTSTAT=NEEDS-ACTION;RSVP=TRUE:MAILTO:attendent@example.com\r\n";
$ical .= "UID:" . strtoupper(md5($event_id)) . "-example.com\r\n";
$ical .= "SEQUENCE:" . $sequence . "\r\n";
$ical .= "STATUS:" . $status . "\r\n";
$ical .= "DTSTAMPTZID=Europe/Berlin:" . date('Ymd') . 'T' . date('His') . "\r\n";
$ical .= "DTSTART:" . $start . "T" . $start_time . "\r\n";
$ical .= "DTEND:" . $end . "T" . $end_time . "\r\n";
$ical .= "LOCATION:" . $location . "\r\n";
$ical .= "SUMMARY:" . $summary . "\r\n";
$ical .= "DESCRIPTION:AnyText\r\n";
$ical .= "BEGIN:VALARM\r\n";
$ical .= "TRIGGER:-PT15M\r\n";
$ical .= "ACTION:DISPLAY\r\n";
$ical .= "DESCRIPTION:Reminder\r\n";
$ical .= "END:VALARM\r\n";
$ical .= "END:VEVENT\r\n";
$ical .= "END:VCALENDAR\r\n";
// Send mail via PHPMailer...
任何建议如何将活动放入组织者的日历(来自外部应用程序),然后谁能够收到与会者的回复?