Laravel Homestead Swift Cannot send message without a sender address

前端 未结 14 983
予麋鹿
予麋鹿 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

    the problem is the null value of MAIL_FROM_ADDRESS in .env file.

    solutions 1: change the value of the MAIL_FROM_ADRESS to match your email address(don t forget to rerun your server). solution 2: keep the .env file as it was but you need to change mail.php(app/config/mail.php):

    from these:

     'from' => [
        'address' => env('MAIL_FROM_ADDRESS','mail@test.com'),
        'name' => env('MAIL_FROM_NAME', 'Example'),
    ]
    

    to:

    'from' => [
        'address' => 'mail@test.com',
        'name' => env('MAIL_FROM_NAME', 'Example'),
    ]
    

提交回复
热议问题