email - php extracting text/plain from mail body -
this content of 1 mail read imap_php library. extract content-type text/plain; charset=iso-8859-1 text:
{"data":"10/10/2011","regione":"pt","provincia":"pistoia","nome":"nome","tel":"12345","email":"mymailaddress","richiesta":"qualcosa"}
if use imap_body($mbox, $result[0]) have returned text in box. if use imap_fetchbody($mbox,$email_number,2); have returned text/html body message don't want.
--20cf301e2f27a218c204a88578aa content-type: text/plain; charset=iso-8859-1 {"data":"10/10/2011","regione":"pt","provincia":"pistoia","nome":"nome","tel":"12345","email":"mymailaddress","richiesta":"qualcosa"}
--20cf301e2f27a218c204a88578aa content-type: text/html; charset=iso-8859-1 content-transfer-encoding: quoted-printable {"data&= quot;:"10/10/2011","regione":"pt","provi= ncia":"pistoia","nome":"nome","tel&= quot;:"12345","email":"mymailaddress","r= ichiesta":"qualcosa"} --20cf301e2f27a218c204a88578aa--
so have use if want text/plain body? thanks.
you need use 1.1 section argument fetch_body() example:
$message = imap_fetchbody($inbox,$email_number, 1.1);
Comments
Post a Comment