官方的例子我看得模糊,而且没成功。它说:
$mail->SMTPSecure = "tls";                 // 我看网上很多人这里是设置ssl,我改了,不行
$mail->Host       = "smtp.gmail.com";      // sets GMAIL as the SMTP server
$mail->Port       = 587; //gmail的端口不是465吗?怎么官方给的是587呢?   我下的版本是5.1的类

解决方案 »

  1.   

    本机报错:
    SMTP -> ERROR: Failed to connect to server: Unable to find the socket transport "ssl" - did you forget to enable it when you configured PHP? (24) 
    SMTP Error: Could not connect to SMTP host. Mailer Error: SMTP Error: Could not connect to SMTP host.php.ini里已经配置使用php_sockets.dll了
      

  2.   

    smtp.gmail.com (use authentication)
    Use Authentication: Yes
    Port for TLS/STARTTLS: 587
    Port for SSL: 465
      

  3.   


    不行,提示:
    SMTP Error: Could not connect to SMTP host. Mailer Error: SMTP Error: Could not connect to SMTP host.我本地windows,会不会和本地环境有关?
      

  4.   

    如果是在家上网, 有些ISP会封掉smtp端口的, 我这边就是, 只能用isp的smtp发