【发布时间】:2012-04-12 21:52:47
【问题描述】:
邮件功能在我的本地主机上运行良好,但是当我将代码上传到服务器 cpanel 时,它会抛出以下错误
SMTP -> ERROR: Failed to connect to server: Connection refused (111)
SMTP Error: Could not connect to SMTP host.
如果我远程登录我的域服务器
220-xxxxx.xxxxxxxxxx.com ESMTP Exim 4.69 #1 Fri, 30 Mar 2012 00:00:13 -050
0
220-We do not authorize the use of this system to transport unsolicited,
220 and/or bulk e-mail.
【问题讨论】:
-
可能是服务器拒绝默认端口 25 上的连接。您检查了吗?试试
telnel mailserver 25 -
cpanel中是否有配置需要配置
-
这取决于托管服务提供商。如果他们关闭了 25 端口,他们肯定打开了 465。你可以使用 sendmail 而不是 SMTP。
-
你能把
echo $this->email->print_debugger();的输出贴出来 -
如果相同的代码在工作,那么问题很可能出在 cpanel 服务器上。你真的可以发布你的电子邮件配置吗?
标签: php codeigniter cpanel