无法使用phpmailer连接到邮件服务器

时间:2016-12-17 18:04:56

标签: php phpmailer

我尝试打开php邮件文件来发短信,它说:

Connection: opening to smtp.gmail.com:587, timeout=300, options=array ()
Connection: Failed to connect to server. Error number 2. "Error notice: stream_socket_client(): unable to connect to smtp.gmail.com:587 (No connection could be made because the target machine actively refused it.)
SMTP ERROR: Failed to connect to server: No connection could be made because the target machine actively refused it. (10061)
SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting
Mailer Error: SMTP connect() failed. https://github.com/PHPMailer/PHPMailer/wiki/Troubleshooting

你们知道怎么解决吗?

1 个答案:

答案 0 :(得分:0)

尝试为您的Gmail启用 Access for less security apps 。建议使用新的电子邮件来做。因为它不太安全。

https://support.google.com/accounts/answer/6010255?hl=en