Closed Hakeemmidan closed 4 years ago
This line might be the issue
'driver' => env('MAIL_DRIVER', 'mandrill'),
In Laravel 7, driver
changed to default
. Might as well update the ENV variable while you are at it to the new one.
'default' => env('MAIL_MAILER', 'mandrill'),
I would also check and try and run php artisan package:discover
after as it might have choked on that config being wrong since it looks like the service provider didn't auto-boot (why its saying the transport doesn't exist)
Thank you for your response.
Changing 'driver'
to 'default'
, and 'MAIL_DRIVER'
to 'MAIL_MAILER'
doesn't fix it. It gives the same error.
Running php artisan package:discover
also gives the same error.
I tried to run php artisan cache:clear
and php artisan config:clear
to see if that was the issue, but I got the same errors there too.
Check your services config file (if you think it is good, paste what you have here for mandrill). I would dd($config)
within the service provider and see what it finds. If the config is empty, that might cause an error.
So my services config file (services.php
) looks something like this:
<?PHP
return [
// ...
'mandrill' => [
'secret' => env('MANDRILL_SECRET', 'exampleSecretString'),
],
// ...
];
By service provider, do you mean AppServiceProvider.php
? If so, I tried doing dd(config()))
(since $config
is not defined anywhere in the project), and I got this:
// ...
"mail" => array:10 [
"driver" => "mandrill"
"host" => "mtp.mandrillapp.com"
"port" => 587
"from" => array:2 [
"address" => "example@example.com"
"name" => "Example"
]
"encryption" => "tls"
"username" => "example@example.com"
"password" => "examplePassword"
"sendmail" => "/usr/sbin/sendmail -bs"
"markdown" => array:2 [
"theme" => "default"
"paths" => array:1 [
0 => "/var/www/resources/views/vendor/mail"
]
]
"log_channel" => null
]
// ...
Side note: I tried changing all variables that have the word mandrill
across the project directory to something else and I still got the "Unsupported mail transport [mandrill].
" error. This made me wonder if it's something on the package or Laravel side. Do you know if anyone has used it with Laravel v7.* (or v7.23.0 more specifically) before?
I unfortunately no longer work for the company where I used this package heavily, but have a v7 freelance project that will use it in the next few weeks. It is installed on it and I am not getting the errors you speak of though.
Was this project you are using it on a recent upgrade from Laravel 6? There might be something missing. Obvious question, but you are using v2.0+ of the package, right?
I see. Yes, actually I just upgraded from Laravel 6 to Laravel 7. So it may be coming from there. I'll look through their upgrade guide again to see if there is something I'm missing. If I find a solution, I'll post it here.
And yes, I'm using v2.0 of the package.
It may be related to compatibility with "fedeisas/laravel-mail-css-inliner"
Laravel package.
In this comment, the comment-author mentioned the exact same error, but for SparkPost email client.
Here's a fix that someone suggested, though it hasn't worked for me.
Update:
Following this comment's suggestion actually worked. I just forgot to run composer dump-autoload
.
Laravel version: 7.23.0 I get this error when I try to run
php artisan queue:listen
orphp artisan schedule:run
, which both have mail sending in them.Error:
mail.php
:And I believe that both
services.php
and.env
are both set up correctly. Any ideas?