简体   繁体   English

我正在尝试使用 laravel 发送电子邮件,但出现此错误“stream_socket_client(): 无法连接到 tcp://smtp.gmail.com:587”

[英]I am trying to send email using laravel and i am getting this error “stream_socket_client(): unable to connect to tcp://smtp.gmail.com:587”

I am trying to run user email verification in my laravel app.我正在尝试在我的 Laravel 应用程序中运行用户电子邮件验证。

But i keep getting this error但我一直收到这个错误

Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Connection timed out)

I have this in my .env我的 .env 中有这个

MAIL_MAILER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=username@gmail.com
MAIL_PASSWORD=password
MAIL_ENCRYPTION=ssl
MAIL_FROM_ADDRESS=username@gmail.com
MAIL_FROM_NAME="${APP_NAME}"

What am i doing wrong我究竟做错了什么

did you turned on the "allow less secure app" in your google account?您是否在 Google 帐户中打开了“允许安全性较低的应用”? it must be on它必须在

暂无
暂无

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 无法使用 smtp.gmail.com 建立 Swift_TransportException 连接 stream_socket_client():无法连接到 tls://smtp.gmail.com:587 - Swift_TransportException Connection could not be established with smtp.gmail.com stream_socket_client(): unable to connect to tls://smtp.gmail.com:587 Getting "Connection could not be established with host smtp.gmail.com:stream_socket_client()" error in laravel 8 on localhost for sending email - Getting "Connection could not be established with host smtp.gmail.com :stream_socket_client()" error in laravel 8 on localhost for sending email Connection could not be established with host smtp.gmail.com:stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 - Connection could not be established with host smtp.gmail.com :stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 连接失败。 错误 #2:stream_socket_client():无法连接到 ssl://smtp.gmail.com:465(连接被拒绝) - Connection failed. Error #2: stream_socket_client(): unable to connect to ssl://smtp.gmail.com:465 (Connection refused) PHP Fatal error: Uncaught Swift_TransportException: Connection could not be established with host ssl://smtp.gmail.com:stream_socket_client() - PHP Fatal error: Uncaught Swift_TransportException: Connection could not be established with host ssl://smtp.gmail.com :stream_socket_client() 尝试使用 smtp.gmail.com 从 gmail 发送电子邮件 - Trying to send email from gmail using smtp.gmail.com 在Codeigniter中无法发送电子邮件-fsockopen():无法连接到ssl://smtp.gmail.com:465(连接被拒绝) - in Codeigniter Unable to send email - fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Connection refused) 无法打开 smtp.gmail.com:587 - Cannot open smtp.gmail.com:587 在php stream_socket_client()中获取错误:无法连接到ssl://gateway.sandbox.push.apple.com:2195(连接被拒绝) - getting error in php stream_socket_client(): unable to connect to ssl://gateway.sandbox.push.apple.com:2195 (Connection refused) [SMTP:无法连接套接字:fsockopen():无法连接至ssl://smtp.gmail.com:465(未知错误)(代码:-1,响应:)] - [SMTP: Failed to connect socket: fsockopen(): unable to connect to ssl://smtp.gmail.com:465 (Unknown error) (code: -1, response: )]
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM