Zend_Mail - read Gmail messages via POP
I am trying to read my Gmail account with Zend_Mail. The request just seems to time out. Is there an issue with my $config
?
public function indexAction()
{
$config = array(
'host'=> 'pop.gmail.com',
'user' => 'xxx',
'password' => 'xxx',
'ssl' => 'tls',
'port' => 995);
$mail = new Zend_Mail_Storage_Pop3($config);
$maxMessage = $mail->countMessages();
$this->view->maxMessage = $maxMessage;
$message = $mail->getMessage(1);
$this->vie开发者_开发问答w->message = $message;
}
I think you need to use SSL as the ssl type. Also, are you using your full email as the username?
$config = array('host'=> 'pop.gmail.com',
'user' => 'xxx',
'password' => 'xxx',
'ssl' => 'SSL',
'port' => 995);
You don't need to enter ssl and port in case of gmail. your config should be
$config = array('host'=> 'pop.gmail.com',
'user' => 'xxx',
'password' => 'xxx');
精彩评论