0

我正在尝试创建一个 .ics 文件以使用 php 发送会议请求。到目前为止一切都很好,但现在我必须在邀请中添加一张图片作为邮件正文的标题。

如何添加标题图片?我尝试使用 Outlook 创建会议,将图像附加到其中,然后另存为 .ics 文件,但我收到警告,所有邮件客户端可能无法查看附件。

我尝试添加此代码,但这不起作用

注意我正在尝试使用 php 创建 .ics 文件。

谢谢

4

1 回答 1

0

Outlook 正在尝试在事件中添加图像。标准 iCalendar 格式确实不支持这一点。但据我了解,您想在电子邮件邀请中添加一张图片,该图片将发送给每位与会者。在这种情况下,您只需将邀请中的 text/html 正文部分替换为包含 text/html 正文部分和 image/xxx 正文部分的 multipart/related,并将两者与 content-id 链接。见https://www.rfc-editor.org/rfc/rfc2392

举一个具体的例子,从雅虎日历发送邀请,就像他们发送图像和邀请一样。

这是他们发送的 MIME 结构的类型:

Content-Type: multipart/mixed;
   Content-Type: multipart/alternative;
      Content-Type: text/plain;
      Content-Type: multipart/related;
         Content-Type: text/html;
           ... your html version, which will include the image as <img src="cid:someuniqueid"/>
         Content-Type: image/gif;
         Content-ID: <someuniqueid>
           ... your image
      Content-Type: text/calendar; charset=utf-8; method=REQUEST
   Content-Type: application/ics; name="invite.ics"
         

      
于 2013-08-28T08:05:12.190 回答