开发者

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');
0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜