官方的例子我看得模糊,而且没成功。它说:
$mail->SMTPSecure = "tls"; // 我看网上很多人这里是设置ssl,我改了,不行
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 587; //gmail的端口不是465吗?怎么官方给的是587呢? 我下的版本是5.1的类
$mail->SMTPSecure = "tls"; // 我看网上很多人这里是设置ssl,我改了,不行
$mail->Host = "smtp.gmail.com"; // sets GMAIL as the SMTP server
$mail->Port = 587; //gmail的端口不是465吗?怎么官方给的是587呢? 我下的版本是5.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了
Use Authentication: Yes
Port for TLS/STARTTLS: 587
Port for SSL: 465
不行,提示:
SMTP Error: Could not connect to SMTP host. Mailer Error: SMTP Error: Could not connect to SMTP host.我本地windows,会不会和本地环境有关?