He mentions the array, also It's optional.
Laravel 7 replaced MAIL_DRIVER by MAIL_MAILER
Note: I am using mailgun driver to deliver e-mail to Mailgun by API and not by SMTP.
The upgrade documentation of Laravel 7 talks about a Mail configuration change. I implemented the new configuration although the old configuration is still valid or compatible.
After implementing the new mail configuration my MAIL_DRIVER provider in the .env was not working anymore. Laravel wanted to send e-mail through smtp which was not configured and it throws out an exception.
The documentation of Laravel 7 still writes: To use the Mailgun driver, first install Guzzle, then set the driver option in your config/mail.php configuration file to mailgun. This is the same text as for Laravel 6 and is is not correct it seems.
I needed to replace MAIL_DRIVER by MAIL_MAILER in my .env file and set it to MAIL_MAILER=mailgun. Next, I opened the config/mail.php and added a new mailer like:
'mailgun' => [
'transport' => 'mailgun',
],
And then it worked again. So before the MAIL_DRIVER skipped any other mail configuration and was using the information directly in config/services but now the flow is different.
Before: .env -> MAIL_DRIVER -> config/services -> Mailgun.
After: .env -> MAIL_MAILER -> config/mail -> config/services -> Mailgun
I think it is more logic but the documentation is not pointing this out. There is no driver option anymore. It is the transport option.
Anybody else noticing this?
Please or to participate in this conversation.