niczak's avatar

Unable to resolve NULL driver for [Illuminate\Mail\TransportManager]. (Sending emails w/ Lumen 5.6)

Hey all -

I followed this guide: https://medium.com/@edwardsteven/using-lumen-and-laravel-mail-with-mailgun-270415daed37 which has you install the illuminate/mail package and register the AppServiceProvider class.

I then created two config files (config/mail.php config/services.php) where mail.php is the default file that comes w/ Laravel and services.php looks like this:

return [
    'mailgun' => [
        'domain' => env('MAILGUN_DOMAIN'),
        'secret' => env('MAILGUN_SECRET'),
    ],
];

I am invoking it the most simple way I know how:

Mail::raw('Raw string email', function($msg) { $msg->to(['[email protected]']); $msg->from(['[email protected]']); });

But I get the following error which I could use help figuring out: Unable to resolve NULL driver for [Illuminate\Mail\TransportManager].

Any insight or a more complete guide that works with Lumen 5.6 would be much appreciated!

0 likes
2 replies
niczak's avatar
niczak
OP
Best Answer
Level 1

I hate to do this, particularly so quickly after posting but I found the issue and of course it all makes sense now.

In my app.php I had done the following:

$app->register(App\Providers\AppServiceProvider::class);
$app->register(Illuminate\Mail\MailServiceProvider::class);

$app->configure('services');

But I had not done the following hence the error about driver being NULL:

$app->configure('mail');

Hopefully this will be helpful information for somebody else down the road!

2 likes

Please or to participate in this conversation.