Thank you for your help Ollie Saunders and lord_webby.
However, it seems I haven't been clear enough. So, here is an other explanation with further examples.
What I would like to do is to extract different parts of an e-mail's body : the newest answer to the message, the answer that has been replied to,... In other word, I would like to split an e-mail, that is the different messages from a discussion between two people.
Sometime, answers look like that :
Code: Select all
Hi
bla bla
----- Original Message -----
From: <mail@mail.com>
To: "Name" <name@ploc.co.uk>
Sent: Saturday, August 32, 2019 11:56 PM
Subject: Re: where is my mind ?
Hi again dear you,
BLA !
I would then like to extract
But the problem is that depending on the language, the client, and the specific configuration of the user, answers can have other layouts, like
Code: Select all
here is the answer
Le 6 août 2015 21:47, <mee@mail.fr> a écrit :
Ah ben trop tard O_o
And the first message
and sometime, the newest part of the message is underneath, and not on the top of the e-mail.
It might be useful to know that every message that is received is stored in a database.