【问题标题】:Zend-mail sending email Connection Timed Out errorZend-mail 发送邮件连接超时错误
【发布时间】:2012-05-09 18:57:06
【问题描述】:

我正在尝试设置一个向新成员发送欢迎电子邮件的注册表单。该表单在我的本地主机上工作得很好,但是当尝试将其上传到远程服务器时,使用提交按钮时页面顶部出现“连接超时”错误。

我正在使用我老师的远程服务器,所以我只能有限地访问服务器。

$mailhost = 'smtp.gmail.com';
$mailconfig = array('auth'      => 'login',
                    'username'  => 'myemail@gmail.com',
                    'password'  => 'xxxxxxxx',
                    'ssl'       => 'ssl',
                    'port'      => '465');
$transport = new Zend_Mail_Transport_Smtp($mailhost, $mailconfig);
Zend_Mail::setDefaultTransport($transport);

$mail = new Zend_Mail('UTF-8');
      $mail->setBodyText($text, 'UTF-8');
      $mail->setBodyHtml($html, 'UTF-8');
      $mail->setFrom('myemail@gmail.com', 'from me');
      $mail->addTo($email, $name);
      $mail->setSubject('Welcome to the page');
      $success = $mail->send();
      if(!$success) {
        $errors = true;
      }

【问题讨论】:

    标签: gmail zend-mail


    【解决方案1】:

    我发现老师的服务器阻塞了导致超时错误的 smtp。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2011-04-22
      • 2014-10-08
      • 2011-03-28
      • 2013-04-13
      • 1970-01-01
      • 1970-01-01
      • 2017-09-30
      • 2011-01-24
      相关资源
      最近更新 更多