Laravel Homestead Swift Cannot send message without a sender address

前端 未结 14 984
予麋鹿
予麋鹿 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 20:03

    error was still occure. after settings and run commands

    php artisan view:clear;
    php artisan config:cache;
    php artisan cache:clear;
    php artisan route:cache;
    

    check the code

    \Illuminate\Support\Facades\Mail::send('layouts.mail', [ 'content' => 'testmail'],    function ($m) use ($msg2){
    $m->from('abc@gmail.com', 'ABC'); 
    // this line was env('MAIL_FROM_ADDRESS') ; cant read from .env
    $m->to('xyz@gmail.com', 'XYZ')->subject('TestMailSubject!');
    ...
    

提交回复
热议问题