Q: PHP imap join plain text correctly Was searching like whole day for solution but could not get any.
While getting the plain/text version of email's body, how to parse it correctly to normal email? I can't find out which newlines are being sent in email by sender, and which are due to long lines split in parts.
Lorem ipsum dolor sit amet.  Lorem ipsum dolor sit amet.  Lorem ipsum dolor
sit amet.  Lorem ipsum dolor sit amet.  Lorem ipsum dolor sit amet.

Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor
sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem
ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit
amet. Lorem ipsum dolor sit amet. Lorem ipsum dolor sit amet. Lorem ipsum
dolor sit amet. Lorem ipsum dolor sit amet.
Sincerely,
Test Tester

2015-03-31 15:58 GMT+03:00 test.com :

>  [test]
>      
> 
>     [image: test tester] 
>  test tester
>  14:58, 31.03.2015
>   answer
> 
> asd
>

As we can see, there is newlines in "Lorem ipsum.." text, and also whole message is split in the parts. But How to get that upper part text in normal readable format?
The HTML version of email contains lot of html tags, and it would be much harder to parse that out, and also not all email clients send in html format.
