Avijit Biswas
Avijit Biswas

Reputation: 51

Laravel Method Illuminate\Mail\Mailer::test does not exist

In my laravel project i use mailgun and guzzlehttp/guzzle. My route code is

 Route::get('/', function () {
    $data = [
      'title'=>'Hellow Avijit',
      'content'=>'This is a testing of mailing in Laravel using mailgun'
    ];

    Mail::test('emails.test', $data, function($message) {
        $message->to('[email protected]', 'Avijit Biswas')
            ->subject('This is Subject');
    });
});

I use

use Illuminate\Support\Facades\Mail;

But after running the project it is seen

Method Illuminate\Mail\Mailer::test does not exist.

I have tried a lot to solve this but i didn't get any solution. What can i do?

Upvotes: 0

Views: 8115

Answers (1)

Himanshu Upadhyay
Himanshu Upadhyay

Reputation: 6565

Use Mail::send() instead of Mail::test()

Because send() is the inbuilt function in Mail.

Upvotes: 1

Related Questions