简体   繁体   English

如何使用php将标头图片包含到.ics文件中?

[英]How to include header image to a .ics file using php?

I am trying to create a .ics file to send meeting request using php. 我正在尝试创建.ics文件以使用php发送会议请求。 Everything is well so far but now I must add an image to the invitation as a header for the body of the message. 到目前为止一切都很好,但是现在我必须在邀请中添加图像作为邮件正文的标题。

How can I add a header image? 如何添加标题图片? I tried to create a meeting using outlook, attach an image to it and then save as .ics file but I get a warning that the attached file may not be view able by all mail clients. 我尝试使用Outlook创建会议,将图像附加到该图像上,然后另存为.ics文件,但收到警告,提示该附件可能无法被所有邮件客户端查看。

I tried ti add this code but this did not work 我试着添加此代码,但这没有用

Note I am trying to create the .ics file using php. 注意我正在尝试使用php创建.ics文件。

Thanks 谢谢

Outlook is trying to add an image in the event . Outlook尝试在事件中添加图像。 This is indeed not supported by standard iCalendar format. 实际上,标准iCalendar格式不支持此功能。 But from what I understand you want to add an image in the email invitation that will go to each attendee. 但是据我了解,您想在电子邮件邀请中添加一张图像,该图像将发送给每个与会者。 In that case, you simply replace the text/html bodypart in your invitation with a multipart/related containing a text/html bodypart and an image/xxx bodypart, and link the two with a content-id. 在这种情况下,您只需用包含text / html正文部分和image / xxx正文部分的multipart / related替换邀请中的text / html正文部分,然后将其与content-id链接。 See http://tools.ietf.org/html/rfc2392 参见http://tools.ietf.org/html/rfc2392

To get a concrete example, send an invitation from a Yahoo Calendar as they do send images along with invitation. 要获得具体示例,请从Yahoo日历发送邀请,因为它们确实会同时发送图像和邀请。

Here is the type of MIME structure that they send: 这是他们发送的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"

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM