[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服务器产生交互。并发送

 


免责声明!

本站转载的文章为个人学习借鉴使用,本站对版权不负任何法律责任。如果侵犯了您的隐私权益,请联系本站邮箱yoyou2525@163.com删除。



 
粤ICP备18138465号  © 2018-2025 CODEPRJ.COM