【发布时间】:2020-11-03 18:24:43
【问题描述】:
当我尝试使用 Gmail SMTP 通过 Laravel 发送电子邮件时,遇到以下错误:
无法与主机 smtp.gmail.com 建立连接:stream_socket_client():无法连接到 ssl://smtp.gmail.com:465(连接超时)
这是错误的痕迹
set_error_handler(function ($type, $msg) {
throw new Swift_TransportException('Connection could not be established with host '.$this->params['host'].' :'.$msg);
});
【问题讨论】:
-
您是否启用了
openssl扩展? -
这有时可能是因为某些东西阻止了目标站点!您的防火墙会不会妨碍您?
-
是的 OpenSSL 已启用
-
OpenSSL 1.1.1 2018 年 9 月 11 日