【问题标题】:Zend_Mail - read Gmail messages via POPZend_Mail - 通过 POP 阅读 Gmail 邮件
【发布时间】:2011-05-27 06:07:07
【问题描述】:

我正在尝试使用 Zend_Mail 读取我的 Gmail 帐户。该请求似乎超时了。我的$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;
}

【问题讨论】:

  • 目前我正在开发测试的本地主机 ;-)

标签: zend-framework gmail pop3 zend-mail


【解决方案1】:

我认为您需要使用 SSL 作为 ssl 类型。另外,您是否使用完整的电子邮件作为用户名?

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

【讨论】:

【解决方案2】:

如果是 gmail,则无需输入 ssl 和端口。 你的配置应该是

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

【讨论】:

    猜你喜欢
    • 2010-10-22
    • 2012-01-02
    • 2011-10-25
    • 1970-01-01
    • 2016-03-03
    • 1970-01-01
    • 1970-01-01
    • 2011-12-04
    • 1970-01-01
    相关资源
    最近更新 更多