Hello! I hope you can help.
We want to make a page called 'mail.php' which will check 5 mailboxes. Our mail server uses POP3, not IMAP and we want this page to return a syntax like this:
mailbox@domain.com: 15 messages, 2 new
mailbox2@domain.com: 23 messages, 3 new
The IMAP script we had was:
$mbox = imap_open("{mail.domain.com}", "mailbox1@domain.com", "password", OP_HALFOPEN)
or die("can't connect: " . imap_last_error());
$status = imap_status($mbox, "{mail.domain.com}INBOX", SA_ALL);
if ($status) {
echo "Messages: " . $status->messages . "<br />\n";
echo "Recent: " . $status->recent . "<br />\n";
echo "Unseen: " . $status->unseen . "<br />\n";
echo "UIDnext: " . $status->uidnext . "<br />\n";
echo "UIDvalidity:" . $status->uidvalidity . "<br />\n";
} else {
echo "imap_status failed: " . imap_last_error() . "\n";
}
imap_close($mbox);
However, our mail server isn't IMAP.
Is it possible for PHP to do this with POP3 instead, what would I need to use?
Many thanks for any help!