我的目标是将激活链接发送给我的注册用户。
这是我的 .env
文件中 SMTP 的设置
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="1c515d555043494f594e525d51592171653179717d75705c7b717d7570327f7371" rel="noreferrer noopener nofollow">[email protected]</a>
MAIL_PASSWORD=khdpqvwzbsvpixvx
我错过了什么吗?我不断得到:
Swift_TransportException in AbstractSmtpTransport.php line 404: Connection to smtp.gmail.com:465 Timed Out
最佳答案
在根项目下打开 .env 文件。在其中编辑以下行:
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=587 #Update from 465 to 587
<a href="https://stackoverflow.com/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="135e525a5f4c464056415d525e562e7e6a767e727a7f53747e727a7f3d707c7e" rel="noreferrer noopener nofollow">[email protected]</a>
MAIL_PASSWORD=yourpassword
重新启动本地网络服务器并且它起作用了。
关于php - AbstractSmtpTransport.php 中的 Swift_TransportException 第 404 行 : Connection to smtp. gmail.com:465 超时,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33630220/