Home > Backend Development > PHP Tutorial > PHPmailer发送邮件失败 在线等!

PHPmailer发送邮件失败 在线等!

WBOY
Release: 2016-06-23 14:09:28
Original
858 people have browsed it

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

貌似楼上的没用啊

source:php.cn
Statement of this Website
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
Popular Tutorials
More>
Latest Downloads
More>
Web Effects
Website Source Code
Website Materials
Front End Template