【发布时间】: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