PHP Classes

email with ics (calendar) shows type/text

Recommend this page to a friend!

      PHP MIME Email Message Parser  >  All threads  >  email with ics (calendar) shows...  >  (Un) Subscribe thread alerts  
Subject:email with ics (calendar) shows...
Summary:email with ics (calendar) shows type/text
Messages:6
Author:RN
Date:2015-05-25 22:28:00
 

  1. email with ics (calendar) shows...   Reply   Report abuse  
Picture of RN RN - 2015-05-25 22:28:00
Even though the email has html content, the main type shows up as text (with sub-type calendar) when processing with $mime->Analyze. I am not sure, but is this right?
Usually if type is text, we would not expect Alternative to be there further down. Or am I missing something here?
Thanks for this great class.


  2. Re: email with ics (calendar) shows...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-05-26 04:14:58 - In reply to message 1 from RN
It is hard to tell without seeing an example. Can you please show an example of a message with that problem complete with headers and body?

  3. Re: email with ics (calendar) shows...   Reply   Report abuse  
Picture of RN RN - 2015-05-26 07:47:04 - In reply to message 2 from Manuel Lemos
Thanks M,
here's the zip with source and output: http://plaenit.com/itms/ics.zip

  4. Re: email with ics (calendar) shows...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-05-26 07:59:31 - In reply to message 3 from RN
Yes, the class is working as expected.

The message has 3 alternative parts of types: text/plain, text/html and text/calendar.

The rule is to take the last your application supports as main type and the others as alternatives.

  5. Re: email with ics (calendar) shows...   Reply   Report abuse  
Picture of RN RN - 2015-05-26 08:29:19 - In reply to message 4 from Manuel Lemos
Oh, I didn't realise such a rule takes precedence! Many thanks!

  6. Re: email with ics (calendar) shows...   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2015-05-26 08:40:53 - In reply to message 5 from RN
Yes, it may not seem evident, but that is the way it works.

Usually HTML messages have a text alternative part that always comes first in the message for old mail readers that only recognize text messages.

So in your case, the last part is the text/calendar part, which is probably to be interpreted by automated scripts. The first two parts should be for humans to read.