您好我想使用php发送日历会议活动。除了Windows 10.Windows 10显示以下输出
但我希望以下信息
这是我的代码
public function Getmail($id) {
//set php variables here
//PHPMailer
$mail = new PHPMailer();
$mail->IsSMTP();
$mail->SMTPDebug = 0;
$mail->SMTPAuth = TRUE;
$mail->SMTPSecure = "ssl";
$mail->Port = 465;
$mail->Username = "****@gmail.com";
$mail->Password = "pass$";
$mail->Host = "smtp.gmail.com";
$mail->Mailer = "smtp";
$mail->SetFrom("user@compnymail.com", "user");
$mail->AddReplyTo("user@compnymail.com", "user");
$mail->addAddress("user1@compnymail.com", "user1");
mail->ContentType = 'text/calendar';
$mail->addCustomHeader('X-Mailer',"Microsoft Office Outlook 12.0");
$mail->addCustomHeader("Content-class: urn:content-classes:calendarmessage");
$ical = "BEGIN:VCALENDAR\r\n";
$ical .= "VERSION:2.0\r\n";
$ical .= "PRODID:-//Microsoft Corporation//Outlook 14.0 MIMEDIR//EN\r\n";
$ical .= "METHOD:REQUEST\r\n";
$ical .= "BEGIN:VEVENT\r\n";
$ical .= "ORGANIZER;CN=".$organizerName.":mailto:".$organizerEmail."\r\n";
$ical .= "ATTENDEE;CN=".$attendeeName.";ROLE=REQ-PARTICIPANT;PARTSTAT=ACCEPTED;RSVP=TRUE:mailto:".$attendeeEmail."\r\n";
$ical .= "UID:".$meeting_id."-google.com\r\n";
$ical .= "SEQUENCE:".$sequence."\r\n";
$ical .= "STATUS:".$status."\r\n";
$ical .= "DTSTART:".$startTime."\r\n";
$ical .= "DTEND:".$endTime."\r\n";
$ical .= "LOCATION:".$location."\r\n";
$ical .= "SUMMARY:".$summary."\r\n";
$ical .= "DESCRIPTION:".$description."\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";
$mail->Body = $ical;
//send the message, check for errors
if(!$mail->send()) {
$this->error = "Mailer Error: " . $mail->ErrorInfo;
return false;
} else {
$this->error = "Message sent!";
return true;
}
代码运行良好,除了Windows 10.请帮助我。非常感谢。