PHP Classes

Unable to parse message with thread

Recommend this page to a friend!

      PHP MIME Email Message Parser  >  All threads  >  Unable to parse message with thread  >  (Un) Subscribe thread alerts  
Subject:Unable to parse message with thread
Summary:No text message decoded
Messages:8
Author:Paul Claridge
Date:2025-12-21 14:45:30
 

  1. Unable to parse message with thread   Reply   Report abuse  
Picture of Paul Claridge Paul Claridge - 2025-12-21 14:45:30
Hi Team

Given the following partial message:

--00000000000025b7270646762d9e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">again again again</div><br><div class=3D"gmail_quote gmail=
_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Sun, 21 Dec 2025=
at 13:17, Paul Claridge &lt;<a href=3D"mailto:paul.claridge56@gmail.com">p=
aul.claridge56@gmail.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail=
_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204=
,204);padding-left:1ex"><div dir=3D"ltr"><div>Ok here we go again again</di=
v><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On S=
un, 21 Dec 2025 at 13:14, Paul Claridge &lt;<a href=3D"mailto:paul.claridge=
56@gmail.com" target=3D"_blank">paul.claridge56@gmail.com</a>&gt; wrote:<br=
></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;=
border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">O=
K here we go again</div><br><div class=3D"gmail_quote"><div dir=3D"ltr" cla=
ss=3D"gmail_attr">On Fri, 19 Dec 2025 at 17:06, Good News BIG Team &lt;<a h=
ref=3D"mailto:site-admin24@goodnewsbig.com" target=3D"_blank">site-admin24@=
goodnewsbig.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pad=
ding-left:1ex">Trust you are well?<br><br>Please include the following refe=
rence: GNBC-1766164018-12 in the subject content of any reply.<br>If you do=
not do as requested we will never see your reply to this thread. Thanks.<b=
r><br><p><br>Regards, Good News BIG Team</p>
</blockquote></div>
</blockquote></div></div>
</blockquote></div>

--00000000000025b7270646762d9e--


I got debug code for $results as follows:

Array
(
[Type] => html
[Description] => HTML message
[Encoding] => utf-8
[DataFile] => /var/www/html/gnb/ci460/public/uploads/GooB9hh6/2
[Alternative] => Array
(
[0] => Array
(
[Type] => text
[Description] => Text message
[Encoding] => utf-8
[DataFile] => /var/www/html/gnb/ci460/public/uploads/GooB9hh6/1
)

)

[Subject] => Re: Making contact (GNBC-1766164018-12)
[Date] => Sun, 21 Dec 2025 13:20:25 +0000
[From] => Array
(
[0] => Array
(
[address] => paul.claridge56@gmail.com
[name] => Paul Claridge
)

)

[To] => Array
(
[0] => Array
(
[address] => site-admin24@goodnewsbig.com
[name] => Good News BIG Team
)

)

)

The contents of file part 1 are:

again again again

On Sun, 21 Dec 2025 at 13:17, Paul Claridge <paul.claridge56@gmail.com>
wrote:

> Ok here we go again again
>
> On Sun, 21 Dec 2025 at 13:14, Paul Claridge <paul.claridge56@gmail.com>
> wrote:
>
>> OK here we go again
>>
>> On Fri, 19 Dec 2025 at 17:06, Good News BIG Team <
>> site-admin24@goodnewsbig.com> wrote:
>>
>>> Trust you are well?
>>>
>>> Please include the following reference: GNBC-1766164018-12 in the
>>> subject content of any reply.
>>> If you do not do as requested we will never see your reply to this
>>> thread. Thanks.
>>>
>>>
>>> Regards, Good News BIG Team
>>>
>>

However file part 2 is NOT written and I cannot seem to extract the actual text message "again again again".

The reason we save the parts is so we can scan them for viruses.

Is this working as intended or do I have to fudge it somehow please?

Appreciate any feedback and/or suggestions
Thx Paul

  2. Re: Unable to parse message with thread   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2025-12-21 23:47:57 - In reply to message 1 from Paul Claridge
Hello Paulo,

Maybe that part is empty.

Can you provide an example EML file with a message that I can use to reproduce the problem, upload it somewhere like Google Drive and reply here with a link?

  3. Re: Unable to parse message with thread   Reply   Report abuse  
Picture of Paul Claridge Paul Claridge - 2025-12-22 14:03:08 - In reply to message 2 from Manuel Lemos
here is the complete message:

From paul.claridge56@gmail.com Sun Dec 21 13:20:39 2025
Received: from mail-yx1-f42.google.com (mail-yx1-f42.google.com [74.125.224.42])
by ikserver2.goodnewsbig.com (8.15.2/8.15.2/Debian-18) with ESMTP id 5BLDKcmG1641968
for <site-admin24@goodnewsbig.com>; Sun, 21 Dec 2025 13:20:39 GMT
Authentication-Results: ikserver2.goodnewsbig.com;
dkim=pass (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20230601 header.b=LiVpqThI;
dkim-atps=neutral
Received: by mail-yx1-f42.google.com with SMTP id 956f58d0204a3-6420c08f886so4124069d50.3
for <site-admin24@goodnewsbig.com>; Sun, 21 Dec 2025 05:20:39 -0800 (PST)
DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=gmail.com; s=20230601; t=1766323238; x=1766928038; darn=goodnewsbig.com;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:from:to:cc:subject:date:message-id:reply-to;
bh=xr6sOuJYb2G0+FASjIIf5V6DGG0ajuQeK6sIAOBILL4=;
b=LiVpqThIlV2mBFhNYQ07QcPBNzHF8gBIlGas5j82xTNvxe/sKC9T2Atnd84M357dzP
yo1icRe8KtngdD+kx3GQCVdPq7EevWmTNCqofzoMx8Wfa3J3G5I2g8qx4wwX4f/2VLEZ
A2YC1Yn6RE701Re1gkdNikYRIIAJJpAlRo3j53VY1TaF3/Dfa3J0r4Aug/P4wNhq/hFm
QkrMLoIFoXg9qIS+Yt6fcoVb6wlfJ7fY65FijAuYN+2oQFgwuKB6zHmnKle+jaHPMyun
MNEpU25pHD8OFaW3wRxfx/I/gMD4BW/xqqnZbcNBBFboXRRatwdsKHjWeE/aR/g8Reao
kaOg==
X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed;
d=1e100.net; s=20230601; t=1766323238; x=1766928038;
h=to:subject:message-id:date:from:in-reply-to:references:mime-version
:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id
:reply-to;
bh=xr6sOuJYb2G0+FASjIIf5V6DGG0ajuQeK6sIAOBILL4=;
b=KO3jSzr8tzJ8OhgXtLK4lGOS/RSphUxWgeiZHRRylYIQdcXT5SoikDX31yz+qiuihF
XijAC7PCoTiOOF+/iK3fEx9pbNB1C5uKTuVxsVKwMmSprtc5iORX9AaxUk7hvkpmSavA
GjquO9Y+U6/qyWmxZNalSPXrxTTTPBB6xmWRQg0RJVKmWGbKfJnODkcj9U4KOttgbHvL
AuXJGqc1ZK28Hg5ht0Dy76LK0RJvprinip11tN4XwKrWV+N44l3f6K9E8hxqDCcXhpSS
67iVJTGZ5LDcOCEltq4hVebPFR72SAoBWMOHO4ZKChfmLfSDY0dXmjARIG/ReEXejaE1
mliw==
X-Gm-Message-State: AOJu0YxozHh6HEIH4KAHcfjUJFVl7mH3952zjjiekT5bIbQswgK8kaQ2
WPSxTI0G7L8ogPJtJrDqLl19mpTP9v7FhwBw+zU/bRtJJJ1Ps86+1y8LqsMpwsL8G5rvhIiMIU0
xUb2bIRI3g+eE0HUcOumT7uz10i4wNH/f3A==
X-Gm-Gg: AY/fxX6VHXA+zTWFkBEx4RYDqFH7bnBsSRnQ1kmDcEDPKlE46yK2/KQhIwoEXOwo60Y
DJRhH9OqGEuhx2tNjHHPO20QdlphnYC2QRhe1aX2zWU/lQfVIj3bH28ATQ8IR3gVGQw9QUlFOdU
vADACSZ3tCO415OlPzRTsAJtKi84kYWuPIQixCOxJaNfSCAVX/Bqj7L1A08LKRfRPNbakOIvY0Q
SdbNnsgC5VWU37tPCCYO/E7PF82lYcfp3QqSvGhDIMggB+CIweZMNvg6NbVoDfX69J3csyUIILP
lKsBHt8aLIBFFxtUVOFwiPYcrA==
X-Google-Smtp-Source: AGHT+IHnFM9aQkbq1LXyLoMAJymRMXd0c8wzDJmPE6sikFCA9ikkqKvV5TNtd9oo87H5YdNC5DqdsB5Dn55vdqARjwg=
X-Received: by 2002:a53:ebc1:0:b0:63f:c487:17ab with SMTP id
956f58d0204a3-6466a8b4b90mr5101647d50.47.1766323237794; Sun, 21 Dec 2025
05:20:37 -0800 (PST)
MIME-Version: 1.0
References: <69458632eb6c01.93834585@goodnewsbig.com> <CA+7+wVn3UEkA0Rb22SMVnnHFa8KixqnvPULKQkzyZ3D1iFN6Rg@mail.gmail.com>
<CA+7+wVnrVhQ4iDBR6xri-S3eAbJG4ymjmYyVN6VLbcmdGG2MoA@mail.gmail.com>
In-Reply-To: <CA+7+wVnrVhQ4iDBR6xri-S3eAbJG4ymjmYyVN6VLbcmdGG2MoA@mail.gmail.com>
From: Paul Claridge <paul.claridge56@gmail.com>
Date: Sun, 21 Dec 2025 13:20:25 +0000
X-Gm-Features: AQt7F2pRWUpTVX3gHchWjgt_2v1RQdo-DmuKh16wIlVZciednBd4kyYE7VyItmY
Message-ID: <CA+7+wVntki9ZRFwK_EH7zhO=Z4StBLNTJmav_-0ndo1LXzEfhQ@mail.gmail.com>
Subject: Re: Making contact (GNBC-1766164018-12)
To: Good News BIG Team <site-admin24@goodnewsbig.com>
Content-Type: multipart/alternative; boundary="00000000000025b7270646762d9e"
X-Virus-Scanned: clamav-milter 0.103.12 at ikserver2
X-Virus-Status: Clean

--00000000000025b7270646762d9e
Content-Type: text/plain; charset="UTF-8"

again again again

On Sun, 21 Dec 2025 at 13:17, Paul Claridge <paul.claridge56@gmail.com>
wrote:

> Ok here we go again again
>
> On Sun, 21 Dec 2025 at 13:14, Paul Claridge <paul.claridge56@gmail.com>
> wrote:
>
>> OK here we go again
>>
>> On Fri, 19 Dec 2025 at 17:06, Good News BIG Team <
>> site-admin24@goodnewsbig.com> wrote:
>>
>>> Trust you are well?
>>>
>>> Please include the following reference: GNBC-1766164018-12 in the
>>> subject content of any reply.
>>> If you do not do as requested we will never see your reply to this
>>> thread. Thanks.
>>>
>>>
>>> Regards, Good News BIG Team
>>>
>>

--00000000000025b7270646762d9e
Content-Type: text/html; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">again again again</div><br><div class=3D"gmail_quote gmail=
_quote_container"><div dir=3D"ltr" class=3D"gmail_attr">On Sun, 21 Dec 2025=
at 13:17, Paul Claridge &lt;<a href=3D"mailto:paul.claridge56@gmail.com">p=
aul.claridge56@gmail.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail=
_quote" style=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204=
,204);padding-left:1ex"><div dir=3D"ltr"><div>Ok here we go again again</di=
v><br><div class=3D"gmail_quote"><div dir=3D"ltr" class=3D"gmail_attr">On S=
un, 21 Dec 2025 at 13:14, Paul Claridge &lt;<a href=3D"mailto:paul.claridge=
56@gmail.com" target=3D"_blank">paul.claridge56@gmail.com</a>&gt; wrote:<br=
></div><blockquote class=3D"gmail_quote" style=3D"margin:0px 0px 0px 0.8ex;=
border-left:1px solid rgb(204,204,204);padding-left:1ex"><div dir=3D"ltr">O=
K here we go again</div><br><div class=3D"gmail_quote"><div dir=3D"ltr" cla=
ss=3D"gmail_attr">On Fri, 19 Dec 2025 at 17:06, Good News BIG Team &lt;<a h=
ref=3D"mailto:site-admin24@goodnewsbig.com" target=3D"_blank">site-admin24@=
goodnewsbig.com</a>&gt; wrote:<br></div><blockquote class=3D"gmail_quote" s=
tyle=3D"margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);pad=
ding-left:1ex">Trust you are well?<br><br>Please include the following refe=
rence: GNBC-1766164018-12 in the subject content of any reply.<br>If you do=
not do as requested we will never see your reply to this thread. Thanks.<b=
r><br><p><br>Regards, Good News BIG Team</p>
</blockquote></div>
</blockquote></div></div>
</blockquote></div>

--00000000000025b7270646762d9e--

  4. Re: Unable to parse message with thread   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2025-12-31 03:59:09 - In reply to message 3 from Paul Claridge
Hello Paul,

That sample message has the headers breaking and that makes the message be different from the original.

Can you send the original EML message attached to an email message to my email address?

  5. Re: Unable to parse message with thread   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2026-01-23 13:52:40 - In reply to message 3 from Paul Claridge
Hello Paul,

I got your message with the sample email message. It works for me.

Meanwhile I noticed that your version of the MIME parser class is 1.91 of 2016 and the latest version is 1.99 of 2024.

You can always get the latest version in two ways:

1. Make sure your are getting email updates when there is an update of the class.

You can check if you are set to get email updates by going to this page below and in the E-mail and newsletters make sure you have set the option "Updated class files alerts" and save your options so you can get an update by email when this and other packages are updated.

phpclasses.org/options.html

2. You can also use PHP composer tool to get the latest version when you request an update. For this package, you can get instructions to set a composer.json file in this page after you have logged in the PHP Classes site.

phpclasses.org/package/3169-PHP-Dec ...

There is an article here to tell how to install and update packages from the PHP Classes site using PHP Composer:

phpclasses.org/blog/post/221-Speedu ...


Can you try the latest version and let me know if the problem still happens?

  6. Re: Unable to parse message with thread   Reply   Report abuse  
Picture of Paul Claridge Paul Claridge - 2026-01-26 11:31:56 - In reply to message 5 from Manuel Lemos
Hi Manuel,

I downloaded and integrated v1.99 as you suggested and it still seems to exhibit the same behaviour ie it seems to lose the parsed message and only returns part of the thread messages.

Thx

  7. Re: Unable to parse message with thread   Reply   Report abuse  
Picture of Manuel Lemos Manuel Lemos - 2026-01-29 03:21:29 - In reply to message 6 from Paul Claridge
Hello Paul,

There may be something different in your environment. If you use PHP cli , can you run the php -v command in the shell and reply here with the output of PHP so I can try to use the exact version that you use to reproduce the problem?

  8. Re: Unable to parse message with thread   Reply   Report abuse  
Picture of Paul Claridge Paul Claridge - 2026-01-29 13:08:22 - In reply to message 7 from Manuel Lemos
I am pleased to say I have made some progress.
Alternative sub-array
When I developed my code a few years back I concluded that the DataFile in the decoded array was the plain text of the message. I then used that to strip out any thread content on the assumption each line began with '>'.

However I have noticed that the plain text message is always in the Alternative sub-array, so I can now access the plain text message correctly. Having said that I notice that part of the thread content is NOT preceded by '>' in the latest Google replies. Is that Rf288 compliant? So when I post process your decoding the text message comes out something like this:

Thank you so much.

I think this is a really good product.

Cheers!

On Wed, 14 Jan 2026 at 13:43, Good News BIG Team <

>
>
>
>

The message should finish at 'Cheers!'

Clearly I can clean this up in my own program but I thought I would point it out to you in case you want to somehow allow for Googles quirky inclusion of the message thread?

I apologise for having taken so long to get to the bottom of this and I did look at your extensive docs but couldn't find any mention of which file was plain text and which was html.

Thx again , Paul