更新时间:2023-01-22 10:36:48
我怀疑是因为你没有设置端口,SMTPSecure 应该是小写的.改变这个:
I suspect it's because you've not set the port, and SMTPSecure should be lower case. Change this:
$mail->SMTPSecure = 'tls';
$mail->Port = 587;
除此之外,请检查您的 ISP/防火墙是否允许您发送出站邮件,以及您的 DNS 是否正常工作.
Beyond that, check that you're allowed to send outbound mail by your ISP/firewall and that your DNS is working.