我們已將電子郵件服務器從一個提供商更改為另一個。使用舊電子郵件設置而不是新電子郵件設置發送的位置。我不確定它是 Laravel 服務器還是電子郵件服務器。我將在這里使用我的域名:example.com我在 .env 中更改了新的電子郵件設置:MAIL_DRIVER=smtpMAIL_HOST=server.example.comMAIL_PORT=465MAIL_USERNAME=no-reply@example.comMAIL_PASSWORD=secretMAIL_ENCRYPTION=ssl當我們發送電子郵件時,我們會在 laravel.log 中收到此異常production.ERROR: Connection to tcp://server.example.com:465 Timed Out {"exception":"[object] (Swift_TransportException(code: 0): Connection to tcp://server.example.com:465 Timed Out at /var/www/example.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/AbstractSmtpTransport.php:473, Swift_IoException(code: 0): Connection to tcp://server.example.com:465 Timed Out at /var/www/example.com/vendor/swiftmailer/swiftmailer/lib/classes/Swift/Transport/StreamBuffer.php:166)我也試過用 tls 而不是 ssl 但同樣的錯誤。我已經使用提供商提供的給定設置在 Thunderbird 中配置了該電子郵件 [email protected] 并且工作正常。電子郵件設置:incoming: IMAP server.example.com 993 SSL/TLS Encrypted password outgoing: SMTP server.example.com 465 SSL/TLS Encrypted passwordusername (email address) and password.我錯過了什么????
2 回答

鴻蒙傳說
TA貢獻1865條經驗 獲得超7個贊
如果您從 Gmail 帳戶發送電子郵件,請嘗試此操作
MAIL_DRIVER=smtp
MAIL_HOST=smtp.gmail.com
MAIL_PORT=465
MAIL_USERNAME=your_email (like [email protected])
MAIL_PASSWORD=secret (when you create a app in your google account then get a app secret)
MAIL_ENCRYPTION=ssl
如果您在 Gmail 中執行此操作,則可以輕松地從您的 Gmail 帳戶發送郵件
- 2 回答
- 0 關注
- 290 瀏覽
添加回答
舉報
0/150
提交
取消