3

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->view->message = $message;
}
Peter Mortensen
  • 30,738
  • 21
  • 105
  • 131
emeraldjava
  • 10,894
  • 26
  • 97
  • 170

2 Answers2

4

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);
wajiw
  • 12,239
  • 17
  • 54
  • 73
  • 1
    Also, I found this code sample you might be able to use: http://code.google.com/p/zoop/source/browse/trunk/apps/request/bin/downloadEmails.php?r=446 – wajiw Dec 17 '10 at 17:26
-2

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');
sra
  • 23,820
  • 7
  • 55
  • 89
hiren
  • 1