Laravel Homestead Swift Cannot send message without a sender address

前端 未结 14 1029
予麋鹿
予麋鹿 2020-12-08 19:09

I get this error with stock email settings in Laravel 5.1 Homestead when I try to send a password reset mail.

Swift_TransportException in AbstractSmtpTransp         


        
14条回答
  •  北荒
    北荒 (楼主)
    2020-12-08 19:47

    If you don't have access to the .env file, you can add default values to those env calls on app/config/mail.php, like this:

        'from' =>  ['address' => env('MAIL_FROM_EMAIL','do_not_reply@email.com'), 'name' => env('MAIL_FROM_NAME','SpongeBob')],
    

    This approach will try to get the data from the .env file, if there's nothing there, it'll default to whatever you set.

提交回复
热议问题