From d3be09a763361aa4fe5a037c07e87ec172eb0609 Mon Sep 17 00:00:00 2001 From: Peter Westwood Date: Wed, 5 Dec 2007 07:39:07 +0000 Subject: [PATCH] Ensure wp-mail doesn't issue a 500 error if no messages are available to post. Fixed #5420 props Bobcat git-svn-id: https://develop.svn.wordpress.org/trunk@6357 602fd350-edb4-49c9-b593-d223f7449a82 --- wp-mail.php | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/wp-mail.php b/wp-mail.php index dc803ed8eb..c8884f6f78 100644 --- a/wp-mail.php +++ b/wp-mail.php @@ -14,9 +14,14 @@ $pop3 = new POP3(); if (!$pop3->connect(get_option('mailserver_url'), get_option('mailserver_port'))) wp_die($pop3->ERROR); -$count = $pop3->login(get_option('mailserver_login'), get_option('mailserver_pass')); -if (0 == $count) wp_die(__('There doesn’t seem to be any new mail.')); +if (!$pop3->user(get_option('mailserver_login'))) + wp_die($pop3->ERROR); +$count = $pop3->pass(get_option('mailserver_pass')); +if (false === $count) + wp_die($pop3->ERROR); +if (0 == $count) + echo "

There doesn't seem to be any new mail.

\n"; // will fall-through to end of for loop for ($i=1; $i <= $count; $i++) :