doudou32012 2014-06-26 01:47 采纳率: 0%
浏览 248
已采纳

ics文件未反映在Outlook日历中

I am trying to send an meeting invite from a php code, I am sending the meeting invite through an ics file. However the ics file is coming in as attachment in Gmail but not being reflected in Ms Outlook.

This is the following File Format that I have:

BEGIN:VCALENDAR
PRODID:-//Microsoft Corporation//Outlook 10.0 MIMEDIR//EN
VERSION:2.0
METHOD:REQUEST
X-MS-OLK-FORCEINSPECTOROPEN:TRUE
BEGIN:VEVENT
ATTENDEE;CN=mail@veershubhranshu.com;RSVP=TRUE:mailto:mail@veershubhranshu.com
ATTENDEE;CN=srivastav.veer@gmail.com;RSVP=TRUE:mailto:srivastav.veer@gmail.com
ATTENDEE;CN=veer@veershubhranshu.com;RSVP=TRUE:mailto:veer@veershubhranshu.com
CLASS:PUBLIC
CREATED:20140626T005704Z
DESCRIPTION:When: Thursday\, June 26\, 2014 10:00 AM-10:30 AM (UTC-08:00) P
    acific Time (US & Canada).
Where: Nowhere

Note: The GMT offset above d
    oes not reflect daylight saving time adjustments.

*~*~*~*~*~*~*~*~*~*

    
sdcsdascsdcs

DTEND:20140626T173000Z
DTSTAMP:20140626T005704Z
DTSTART:20140626T170000Z
LAST-MODIFIED:20140626T005704Z
LOCATION:Nowhere
ORGANIZER;CN="Veer Shubhranshu Shrivastav":mailto:mail.@veershubhranshu.com
PRIORITY:5
SEQUENCE:0
SUMMARY;LANGUAGE=en-us:Test Meeting
TRANSP:OPAQUE
UID:040000008200E00074C5B7101A82E00800000000E02849DF9E90CF01000000000000000
    010000000D1CC646A48A62440A0D2308D1F4960AA
X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//E
    N">
<HTML>
<HEAD>
<META NAME="Generator" CONTENT="MS Exchange Server ve
    rsion 08.00.0681.000">
<TITLE></TITLE>
</HEAD>
<BODY>
<!-- Converted f
    rom text/rtf format -->

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calib
    ri">When: Thursday\, June 26\, 2014 10:00 AM-10:30 AM (UTC-08:00) Pacific 
    Time (US &amp\; Canada).</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us
    "><FONT FACE="Calibri">Where: Nowhere</FONT></SPAN></P>

<P DIR=LTR><SPA
    N LANG="en-us"><FONT FACE="Calibri">Note: The GMT offset above does not re
    flect daylight saving time adjustments.</FONT></SPAN></P>

<P DIR=LTR><S
    PAN LANG="en-us"><FONT FACE="Calibri">*~*~*~*~*~*~*~*~*~*</FONT></SPAN></P
    >

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">sdcsdascsdcs</FONT
    ></SPAN><SPAN LANG="en-us"></SPAN></P>

</BODY>
</HTML>
X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE
X-MICROSOFT-CDO-IMPORTANCE:1
X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY
X-MICROSOFT-DISALLOW-COUNTER:FALSE
X-MS-OLK-ALLOWEXTERNCHECK:TRUE
X-MS-OLK-AUTOSTARTCHECK:FALSE
X-MS-OLK-CONFTYPE:0
X-MS-OLK-SENDER;CN="Veer Shubhranshu Shrivastav":mailto:mail@veershubhranshu.com
BEGIN:VALARM
TRIGGER:-PT15M
ACTION:DISPLAY
DESCRIPTION:Reminder
END:VALARM
END:VEVENT
END:VCALENDAR

I am not able to figure out where is the problem. This is my Php code

<?php
$domain = 'xyz.com';

//Create Email Headers
$mime_boundary = "----Meeting Booking----".MD5(TIME());

$headers = "From: ".$from_name." <".$from_address.">
";
$headers .= "Reply-To: ".$from_name." <".$from_address.">
";
$headers .= "MIME-Version: 1.0
";
$headers .= "Content-Type: multipart/alternative; boundary=\"$mime_boundary\"
";
$headers .= "Content-class: urn:content-classes:calendarmessage
";

//Create Email Body (HTML)
$message = "--$mime_boundary
";
$message .= "Content-Type: text/html; charset=UTF-8
";
$message .= "Content-Transfer-Encoding: 8bit

";
$message .= "<html>
";
$message .= "<body>
";
$message .= '<p>Dear '.$to_name.',</p>';
$message .= '<p>'.$description.'</p>';
$message .= "</body>
";
$message .= "</html>
";
$message .= "--$mime_boundary
";

$ical =
'BEGIN:VCALENDAR' . "
" .
'PRODID:-//Microsoft Corporation//Outlook 10.0 MIMEDIR//EN' . "
" .
'VERSION:2.0' . "
" .
'METHOD:REQUEST' . "
" .
'X-MS-OLK-FORCEINSPECTOROPEN:TRUE'."
".
'BEGIN:VEVENT'."
".
'ATTENDEE;CN=mail@veershubhranshu.com;RSVP=TRUE:mailto:mail@veershubhranshu.com'."
".
'ATTENDEE;CN=srivastav.veer@gmail.com;RSVP=TRUE:mailto:srivastav.veer@gmail.com'."
".
'ATTENDEE;CN=veer@veershubhranshu.com;RSVP=TRUE:mailto:veer@veershubhranshu.com'."
".
'CLASS:PUBLIC'."
".
'CREATED:20140626T005704Z'."
".
'DESCRIPTION:When: Thursday\, June 26\, 2014 10:00 AM-10:30 AM (UTC-08:00) P
acific Time (US & Canada).
Where: Nowhere

Note: The GMT offset above d
oes not reflect daylight saving time adjustments.

*~*~*~*~*~*~*~*~*~*


sdcsdascsdcs
'."
".
'DTEND:20140626T173000Z'."
".
'DTSTAMP:20140626T005704Z'."
".
'DTSTART:20140626T170000Z'."
".
'LAST-MODIFIED:20140626T005704Z'."
".
'LOCATION:Nowhere'."
".
'ORGANIZER;CN="Veer Shubhranshu Shrivastav":mailto:mail.@veershubhranshu.com'."
".
'PRIORITY:5'."
".
'SEQUENCE:0'."
".
'SUMMARY;LANGUAGE=en-us:Test Meeting'."
".
'TRANSP:OPAQUE'."
".
'UID:040000008200E00074C5B7101A82E00800000000E02849DF9E90CF01000000000000000
010000000D1CC646A48A62440A0D2308D1F4960AA'."
".
'X-ALT-DESC;FMTTYPE=text/html:<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2//E
N">
<HTML>
<HEAD>
<META NAME="Generator" CONTENT="MS Exchange Server ve
rsion 08.00.0681.000">
<TITLE></TITLE>
</HEAD>
<BODY>
<!-- Converted f
rom text/rtf format -->

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calib
ri">When: Thursday\, June 26\, 2014 10:00 AM-10:30 AM (UTC-08:00) Pacific 
Time (US &amp\; Canada).</FONT></SPAN></P>

<P DIR=LTR><SPAN LANG="en-us
"><FONT FACE="Calibri">Where: Nowhere</FONT></SPAN></P>

<P DIR=LTR><SPA
N LANG="en-us"><FONT FACE="Calibri">Note: The GMT offset above does not re
flect daylight saving time adjustments.</FONT></SPAN></P>

<P DIR=LTR><S
PAN LANG="en-us"><FONT FACE="Calibri">*~*~*~*~*~*~*~*~*~*</FONT></SPAN></P
>

<P DIR=LTR><SPAN LANG="en-us"><FONT FACE="Calibri">sdcsdascsdcs</FONT
></SPAN><SPAN LANG="en-us"></SPAN></P>

</BODY>
</HTML>'."
".
'X-MICROSOFT-CDO-BUSYSTATUS:TENTATIVE'."
".
'X-MICROSOFT-CDO-IMPORTANCE:1'."
".
'X-MICROSOFT-CDO-INTENDEDSTATUS:BUSY'."
".
'X-MICROSOFT-DISALLOW-COUNTER:FALSE'."
".
'X-MS-OLK-ALLOWEXTERNCHECK:TRUE'."
".
'X-MS-OLK-AUTOSTARTCHECK:FALSE'."
".
'X-MS-OLK-CONFTYPE:0'."
".
'X-MS-OLK-SENDER;CN="Veer Shubhranshu Shrivastav":mailto:mail@veershubhranshu.com'."
".
'BEGIN:VALARM'."
".
'TRIGGER:-PT15M'."
".
'ACTION:DISPLAY'."
".
'DESCRIPTION:Reminder'."
".
'END:VALARM'."
".
'END:VEVENT'."
".
'END:VCALENDAR'."
";
$message .= 'Content-Type: text/calendar;name="veer-invite.ics";method=REQUEST
';
$message .= "Content-Transfer-Encoding: 8bit

";
$message .= $ical;

$mailsent = mail($to_address, $subject, $message, $headers);
?>
  • 写回答

2条回答 默认 最新

  • dongyuli0964 2014-06-26 06:03
    关注

    There's some great investigation of this problem in this open issue in PHPMailer. Though it's not a problem of PHPMailer's making (it's Outlook's fault), there's no easy way to build the workaround in PHPMailer - you may be better off usig a different system to build your MIME structure, such as Zend_MIME.

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论
查看更多回答(1条)

报告相同问题?

悬赏问题

  • ¥15 PointNet++的onnx模型只能使用一次
  • ¥20 西南科技大学数字信号处理
  • ¥15 有两个非常“自以为是”烦人的问题急期待大家解决!
  • ¥30 STM32 INMP441无法读取数据
  • ¥15 R语言绘制密度图,一个密度曲线内fill不同颜色如何实现
  • ¥100 求汇川机器人IRCB300控制器和示教器同版本升级固件文件升级包
  • ¥15 用visualstudio2022创建vue项目后无法启动
  • ¥15 x趋于0时tanx-sinx极限可以拆开算吗
  • ¥500 把面具戴到人脸上,请大家贡献智慧,别用大模型回答,大模型的答案没啥用
  • ¥15 任意一个散点图自己下载其js脚本文件并做成独立的案例页面,不要作在线的,要离线状态。