I would like to convert an email thread into a xml stream with the below format:
<emails>
<email index="1">
<email_attr>
These are the attributes (from, to, date, subject) of the 1st email
</email_attr>
<email_content>
This is the content of the 1st email
</email_content>
</email>
<email index="2">
<email_attr>
These are the attributes (from, to, date, subject) of the 2nd email
</email_attr>
<email_content>
This is the content of the 2nd email
</email_content>
</email>
...
</emails>
I tried 2 methods
1- Using the corresponding eml file. But the format differs between gmail / outlook and between languages. It is too complicated to take into account all the scenarios.
2- Using gmail APIs but forwarded emails would be counted as a unique message. The API doesn’t manage to isolate each message from the forwarded thread.