当前位置:Gxlcms > PHP教程 > PHPmailer发送邮件失败在线等!

PHPmailer发送邮件失败在线等!

时间:2021-07-01 10:21:17 帮助过:18人阅读

发送错误提示:
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

貌似楼上的没用啊

人气教程排行