[PHP开发] phpmailer问题 错误原因: Could not instantiate mail function

 Send via the PHP mail() function
    function mail_send($header, $body) {
        // Create mail recipient list
        $to = $this->to[0][0]; // no extra comma
        for($x = 1; $x < count($this->to); $x++)
            $to .= sprintf(",%s", $this->to[$x][0]);
        for($x = 0; $x < count($this->cc); $x++)
            $to .= sprintf(",%s", $this->cc[$x][0]);
        for($x = 0; $x < count($this->bcc); $x++)
            $to .= sprintf(",%s", $this->bcc[$x][0]);
         
        if(!mail($to, $this->Subject, $body, $header))
            $this->error_handler("Could not instantiate mail()");
    }}

这就说明了是mail 函数调用不成功造成的,也就是你设置的问题,导致没有使用SMTP来发信,而还是使用内置的mail函数,而你的服务器不支持mail函数。

 could not instantiate mail function 不能实现mail方法

mail的工作原理。mail函数可以与php.ini 指定的smtp服务器产生交互。并发送

 

posted @ 2014-04-11 23:43  闲云-野鹤  阅读(4223)  评论(0)    收藏  举报