Zend_Mail - Read Gmail Messages through POP

I am trying to read my Gmail account using Zend_Mail. The request just seems to time out. Is there a problem with mine $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->view->message = $message;
}
+3
source share
2 answers

I think you need to use SSL as an ssl type. Also, do you use your full email address as your username?

$config = array('host'=> 'pop.gmail.com',
        'user' => 'xxx',
        'password' => 'xxx',
        'ssl' => 'SSL',
        'port' => 995);
+4
source

You do not need to enter ssl and port in case of gmail. your config should be

$config = array('host'=> 'pop.gmail.com',
        'user' => 'xxx',
        'password' => 'xxx');
-2
source

Source: https://habr.com/ru/post/1780909/


All Articles