问题分析
本地调试开发正常,代码发布到阿里云服务器上线测试出现如下报错
exception: "Swift_TransportException"
message: "Connection could not be established with host smtp.exmail.qq.com :stream_socket_client(): unable to connect to ssl://smtp.exmail.qq.com:25 (Connection timed out)"
file: "/www/wwwroot/0.0.0.0/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php"
解决方法
编辑 .env 文件,修改如下
MAIL_PORT=465
MAIL_ENCRYPTION=SSL
问题分析
默认的25端口被阿里云互联网管控了,禁止使用
如果一定要使用25端口,可到阿里云申请