2

这是我的代码:

    function sendMail($template = null, $to_email = null, $from_email = null,
   $subject = null,  $contents = array()) {
$this->Email->to  = $to_email;
$this->Email->subject = $subject;
$this->Email->from =$from_email;
$this->Email->template = $template;
$this->Email->sendAs = 'html';

$this->Email->smtpOptions = array(
    'timeout'=>'30',
    'port' => '25',
    'host' => 'relay.jangosmtp.net',
    'username' => 'users',
    'password' => 'pass',
    'transport' => 'Smtp',
    'tls' => true
);
$this->Email->delivery = 'smtp';


    $this->set('contents', $content);
    $this->Email->send();

}

我收到错误,因为“没有主机路由”有人可以帮我解决这个问题吗?

4

1 回答 1

1

“没有到主机的路由”表示这不是脚本的问题,而更有可能是您的邮件服务器的配置问题。

https://www.google.com/search?q=smtp+No+route+to+host

于 2013-08-20T00:38:19.903 回答