我正在尝试通过我的 php 代码发送日历请求邮件。我收到了邮件和日历。但是我的开始日期有问题。如何根据海湾标准时间配置开始日期。现在我根据格林威治标准时间得到,虽然我没有提到任何地方。简而言之,如果我将在上午 7 点发送请求,那么在开始日期它将显示上午 11 点。我的代码是这样的:
$dtstart = $start_date_conf;
$dtend=$end_date_conf;
$todaystamp = date("Ymd\THis\Z");
//Create unique identifier
$cal_uid = date('Ymd').'T'.date('His')."-".rand()."@fugenx.com";
//Create Mime Boundry
$mime_boundary = "----Bespot Meeting Booking----".md5(time());
//Create Email Headers
$headers = "From: ".$from_name." <".$from_address.">\n";
$headers .= "Reply-To: ".$from_name." <".$from_address.">\n";
$headers .= "MIME-Version: 1.0\n";
$headers .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\"\n";
$headers .= "Content-class: urn:content-classes:calendarmessage\n";
//Create Email Body (HTML)
$message .= "--$mime_boundary\n";
$message .= "Content-Type: text/html; charset=UTF-8\n";
$message .= "Content-Transfer-Encoding: 8bit\n\n";
$message .= "<html>\n";
$message .= "<body>\n";
$message .= '<p>'.$messagess.'</p>';
$message .= '<p></p><p></p>';
$message .= '<p><b>Thanks & Regards,:</b></p>';
$message .= '<p>'.$full_name.'</p>';
$message .= '<p>'.$full_address.'</p>';
$message .= '<p>'.$email_address.'</p>';
$message .= '<p>'.$mobile_number.'</p>';
$message .= "</body>\n";
$message .= "</html>\n";
$message .= "--$mime_boundary\n";
//Create ICAL Content (Google rfc 2445 for details and examples of usage)
$ical = "BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 11.0 MIMEDIR//EN
VERSION:2.0
METHOD:REQUEST
BEGIN:VEVENT
ORGANIZER:MAILTO:".$from_address."
DTSTART:".$dtstart."
DTEND:".$dtend."
LOCATION:".$meeting_location."
TRANSP:OPAQUE
SEQUENCE:0
UID:".$cal_uid."
DTSTAMP:".$todaystamp."
DESCRIPTION:".$meeting_description."
SUMMARY:".$subject."
PRIORITY:5
CLASS:PUBLIC
END:VEVENT
END:VCALENDAR";
$message .= "Content-Type: text/calendar;method=REQUEST;charset=utf-8\n";
//$message .= "Content-Type: text/calendar;name=\"meeting.ics\";method=REQUEST\n";
$message .= "Content-Transfer-Encoding: 8bit\n\n";
$message .= $ical;
//SEND MAIL
$mail_sent = @mail( $email, $subject, $message, $headers );