tutto ciò usando pear... altrimenti nn saprei come fare:
invio(che funziona, ma se ti interessa):

function sendMail($from,$rcpt,$sub,$data,$server)
{

$text = 'Text version of email';
html = '<html><body>HTML version of email</body></html>';
$crlf = "\r\n";
$hdrs = array(
'From' => $from,
'Subject' => $sub,
'Date'=> date(r)
);
$mime = new Mail_mime($crlf);
echo $data;
$mime->setTXTBody($data);
$mime->setHTMLBody($html);
$body = $mime->get();
$hdrs = $mime->headers($hdrs);
$params['host'] = $server;
$mail =& Mail::factory('smtp',$params);
$mail->send($rcpt, $hdrs, $data);
}
ricezione(funziona ma nn stampa solo il corpo del messaggio)
function retBody($pop,$numMsg)
{
$body=$pop->getBody($numMsg);
$params['include_bodies'] = true;
$params['decode_bodies'] = true;
$params['decode_headers'] = true;
$params['input'] = $body;
$params['crlf'] = "\r\n";
$decoder = new Mail_mimeDecode($body);
$body = $decoder->decode($params);
return $body;
}