【问题标题】:SMTP not working on Code Igniter when I deployed the code on production当我在生产环境中部署代码时,SMTP 无法在 Code Igniter 上运行
【发布时间】:2014-07-13 02:01:20
【问题描述】:

我使用 smtp gmail 创建了一个电子邮件。我的代码在开发中工作,但是当我将它部署到生产环境时它不起作用。

$config['smtp_host'] = "ssl://smtp.gmail.com"; 




A PHP Error was encountered
Severity: Warning
Message: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Connection timed out)
Filename: libraries/Email.php
Line Number: 1689

The following SMTP error was encountered: 110 Connection timed out
Unable to send data: AUTH LOGIN
Failed to send AUTH LOGIN command. Error: 
Unable to send data: MAIL FROM:

from: 
The following SMTP error was encountered: 
Unable to send data: RCPT TO:
to: 
The following SMTP error was encountered: 
Unable to send data: DATA
data: 

我之前在开发中遇到过这个问题,修复只是添加了这一行。 $this->email->set_newline("\r\n"); 但它不适用于生产。

【问题讨论】:

    标签: php codeigniter email ssl smtp


    【解决方案1】:

    Connection timed out 表示它甚至无法连接到服务器。 如果这在开发中有效,但在生产中无效,您可能在生产系统前面有防火墙来保护它,这会阻止访问。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 2013-08-24
      • 2021-11-28
      • 2014-05-23
      • 1970-01-01
      • 1970-01-01
      • 2018-10-16
      • 2016-01-23
      • 2014-11-09
      相关资源
      最近更新 更多