热搜:NVER node 开发 php

PHPmailer发送邮件失败 在线等!

2024-09-11 17:00:01
PHPmailer发送邮件失败 在线等!

发送错误提示:
SMTP Error: Could not connect to SMTP host. Mailer Error (9475@qq.com) SMTP Error: Could not connect to SMTP host.
本地测试正常  上传到服务器上就出错了  
当我把类中的函数
public function IsSMTP() 
{
    $this->Mailer = 'smtp';  //改成 $this->Mailer = 'SMTP'; 就可以发送 但是发送的邮件标题重复 并且被当做垃圾邮件处理 
}

怎么解决 ??  



回复讨论(解决方案)

CSDN 有没有老鸟...

更改phpmailer 的 class.stmp.php文件:

$this->smtp_conn = @fsockopen( $host,    // the host of the server
                                  $port,    // the port to use
                                  $errno,   // error number if any
                                  $errstr,  // error message if any
                                  $tval);   // give up after ? secs
改为
$this->smtp_conn = @stream_socket_client( $host.':'.$port,    // the host of the server
                        $errno,   // error number if any
                        $errstr,  // error message if any
                        $tval);   // give up after ? secs

貌似楼上的没用啊