Decode mail's body using PEAR
Posted: Thu Oct 09, 2003 10:40 am
Hi, I have problems showing the message's body. If it was went by Outlook, for example, this is the result:
------=_NextPart_000_0001_01C38E89.E2240120
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Esto es un mensaje de prueba
------=_NextPart_000_0001_01C38E89.E2240120
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I try to decode it using mimeDecode class of PEAR, but nothing changes:
require_once 'Mail/mimeDecode.php';
$conmail = imap_open("{myserver/pop3:110}INBOX","user","password");
$body = imap_body($conmail, $id);
$params['include_bodies'] = true;
$params['decode_bodies'] = true;
$params['decode_headers'] = true;
$params['input'] = $body;
$structure = Mail_mimeDecode::decode($params);
echo $structure->body;
Thank you very much
------=_NextPart_000_0001_01C38E89.E2240120
Content-Type: text/plain;
charset="iso-8859-1"
Content-Transfer-Encoding: 7bit
Esto es un mensaje de prueba
------=_NextPart_000_0001_01C38E89.E2240120
Content-Type: text/html;
charset="iso-8859-1"
Content-Transfer-Encoding: quoted-printable
I try to decode it using mimeDecode class of PEAR, but nothing changes:
require_once 'Mail/mimeDecode.php';
$conmail = imap_open("{myserver/pop3:110}INBOX","user","password");
$body = imap_body($conmail, $id);
$params['include_bodies'] = true;
$params['decode_bodies'] = true;
$params['decode_headers'] = true;
$params['input'] = $body;
$structure = Mail_mimeDecode::decode($params);
echo $structure->body;
Thank you very much