I had similar issues. I managed to get it working like this for Mailgun:
In bootstrap\app.php place this in the register service providers section:
$app->register(App\Providers\AppServiceProvider::class);
In your AppServiceProviders:
$this->app->configure('services');
$this->app->singleton('mailer', function ($app) {
return $app->loadComponent('mail', 'Illuminate\Mail\MailServiceProvider', 'mailer');
});
$this->app->alias('mailer', \Illuminate\Contracts\Mail\Mailer::class);
Then you need to add a config folder in your base folder.
config\services.php:
<?php
return [
'mailgun' => [
'domain' => env('MAILGUN_DOMAIN'),
'secret' => env('MAILGUN_SECRET'),
],
];
and config\mail.php:
<?php
return [
'driver' => env('MAIL_DRIVER'),
'host' => env('MAIL_HOST'),
'port' => env('MAIL_PORT'),
'from' => [
'address' => env('MAIL_FROM_ADDRESS'),
'name' => env('MAIL_FROM_NAME'),
],
'encryption' => env('MAIL_ENCRYPTION'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
];
This allowed me to use the Laravel Notifications and use the Mail option.