Получение почты при помощи imap

<?php
$box = imap_open("{pop.mail.ru/pop3:110}", 'mylo@inbox.ru', 'password');
 
echo '<pre>Писем: ';
echo $count = imap_num_msg($box);
echo "\n\n";
 
$i=1;
while ($i<=$count) {
    $overview = imap_fetch_overview($box, $i);
    echo 'тема: '. imap_utf8($overview[0]->subject);
    echo "\n";
    $body =  imap_body($box, $i);
    $body = imap_qprint($body);
    $body = iconv('windows-1251', 'utf-8', $body);
    echo "$body \n\n***********\n\n";
    $i++;
}
 
imap_close($box);