简体   繁体   中英

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. 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.

I tried ti add this code but this did not work

Note I am trying to create the .ics file using php.

Thanks

Outlook is trying to add an image in the event . This is indeed not supported by standard iCalendar format. 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. See 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.

Here is the type of MIME structure that they send:

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"

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

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