Mathieu Maes - 2005-08-08 22:18:28
Hello !
I'm implementing Parse mail in a PHP script which receives mails with STDIN. All worked fine for now, until I tested with HTML or multipart mail messages. The mail message body is screwed up ! :
print_r ($email[part]) gives me :
[0] => Array
(
[Content-Type] => multipart/alternative;
boundary="----=_Part_2132_14882511.1123538473424"
[content] => ------=_Part_2132_14882511.1123538473424
Content-Type: text/plain; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
test message
------=_Part_2132_14882511.1123538473424
Content-Type: text/html; charset=ISO-8859-1
Content-Transfer-Encoding: quoted-printable
Content-Disposition: inline
test message
------=_Part_2132_14882511.1123538473424--
)
1. is there a way how to detect a multipart mail ?
2. how can I parse it so I get the plain text message only ??