Goodvin's avatar

Why Lumen don't want to send Mailable messages

Hi, I'am working with Lumen and can't send Mailable messages.

Mailable class is very simple

<?php

namespace App\Mail;
use Illuminate\Mail\Mailable;
use Illuminate\Queue\SerializesModels;

class OrderNote extends Mailable
{
    use SerializesModels;

    public function __construct() {}

    public function build()
    {
        return $this->from('[email protected]')
            ->subject('New note')
            ->view('email.test');
    }
}

In controller only

Mail::to('[email protected]')
    ->send(new OrderNote());

But nothing happened, when controller method execute. Why Mailable don't work?

PS. I'am trying in controller

Mail::send('email.test', [], function ($message) {

    $message->from('[email protected]');
    $message->to('[email protected]', 'John Smith')->subject('Welcome!');
});

and it is works fine.

Thanks in advance!

0 likes
1 reply

Please or to participate in this conversation.