Laravel:AWS上的Office365连接超时

问题描述

不知道为什么smtp.office365.com突然停止了生产工作,却继续开发。 让我们看一些代码

.env配置

MAIL_DRIVER=smtp
MAIL_HOST=smtp.office365.com
MAIL_PORT=25
[email protected]
MAIL_PASSWORD=********
MAIL_ENCRYPTION=tls
MAIL_SMTPAuth=true
MAIL_FROM_NAME="Grupo Primo Rossi"
[email protected]

Laravel错误页面

Swift_TransportException
Connection Could not be established with host smtp.office365.com [Connection timed out #110]

最奇怪的是,当我发布并无故停止工作时,此配置可以正常工作。

有人吗? 预先感谢!

解决方法

已解决! 将港口从25调整为587

MAIL_DRIVER=smtp
MAIL_HOST=smtp.office365.com
MAIL_PORT=587
[email protected]
MAIL_PASSWORD=********
MAIL_ENCRYPTION=tls
MAIL_SMTPAuth=true
MAIL_FROM_NAME="Grupo Primo Rossi"
[email protected]

现在一切正常!