我在發送電子郵件時收到 mailhog 錯誤。
錯誤:
Connection could not be established with host mailhog :stream_socket_client(): unable to connect to null://mailhog:1025 (Unable to find the socket transport "null" - did you forget to enable it when you configured PHP?)
我的代碼:
Mail::to('[email protected]')->send(new MessageMail($message));
和 .env 配置:
MAIL_MAILER=smtp
MAIL_HOST=mailhog
MAIL_PORT=1025
MAIL_USERNAME=
MAIL_PASSWORD=
MAIL_ENCRYPTION=null
[email protected]
MAIL_FROM_NAME="${APP_NAME}"
我使用 docker,我的 laravel 版本是 8,PHP 版本是 7.4.10,我正在從 symfony 遷移到 laravel。
uj5u.com熱心網友回復:
正如Ken Lee在評論中所說:
您對 . 使用了無效值 ( null) MAIL_ENCRYPTION。
MAIL_ENCRYPTION=null
使用空值代替MAIL_ENCRYPTION:
MAIL_ENCRYPTION=
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/513315.html
