我正在尝试使用 Laravel 从本地主机从 Gmail 发送电子邮件。我收到此错误:
Connection could not be established with host smtp.googlemail.com
:stream_socket_client(): unable to connect to ssl://smtp.googlemail.com:465
(A connection attempt failed because the connected party did not properly
respond after a period of time, or established connection failed because
connected host has failed to respond.)
Run Code Online (Sandbox Code Playgroud)
我的 .env 文件:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.googlemail.com
MAIL_PORT=465
MAIL_USERNAME=myusername@gmail.com
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=ssl
Run Code Online (Sandbox Code Playgroud)
错误是什么?我需要更改服务器或防火墙中的某些设置吗?
在 .env 文件中尝试以下代码:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587
mail_username=myusername@gmail.com
MAIL_PASSWORD=mypassword
MAIL_ENCRYPTION=tls
Run Code Online (Sandbox Code Playgroud)
| 归档时间: |
|
| 查看次数: |
19858 次 |
| 最近记录: |