我知道有关于此主题的大量问题,但仍无法弄清楚发生了什么问题。CakePHP SMTP连接超时
这里是我的代码:
$this->Email->to = '[email protected]';
$this->Email->subject = 'any subject';
$this->Email->replyTo = '[email protected]';
$this->Email->from = 'Somebody <[email protected]>';
$this->Email->additionalParams = '[email protected]';
$this->Email->template = 'my_template';
$this->Email->sendAs = 'text';
$this->Email->smtpOptions = array(
'port'=>'465',
'timeout'=>'30',
'host' => 'ssl://smtp.googlemail.com', // also tried smtp.gmail.com
'username'=>'username',
'password'=>'pass',
);
$this->Email->send();
现在,这会导致什么,但 “连接超时:110”。我尝试了其他几种邮件服务。总是得到连接错误。
帮助非常赞赏。
男人我得到了同样的错误,再次在另一台服务器,它工作正常,只是问题是我不能移动到另一台服务器。你找出确切的问题是什么?谢谢 – dav 2014-10-24 14:54:12
检查您的服务器上是否安装了邮件传输代理。也许使用普通的PHP脚本(http://www.rackspace.com/knowledge_center/article/how-can-i-test-php-mail-functionality),如果失败,请询问您的提供商。 – Chrisissorry 2014-10-24 18:05:50
感谢您的答复,是的,因为它竟然使用另一个SMTP帐户被禁止。谢谢 – dav 2014-10-24 18:07:10