I have an error when try to send mail to mailhog with laravel, is the follow:
The "" scheme is not supported; supported schemes for mailer "smtp" are: "smtp", "smtps".
Env file config:
MAIL_MAILER=smtp
MAIL_HOST=localhost
MAIL_PORT=1025
MAIL_USERNAME=null
MAIL_PASSWORD=null
MAIL_ENCRYPTION=null
MAIL_FROM_ADDRESS="[email protected]"
MAIL_FROM_NAME="${APP_NAME}"
my route code:
Route::get('/email', function () {
Mail::raw('Mensagem de teste de RH MANAGMENT', function (Message $message) {
$message->to('[email protected]')->subject('Recursos Humanos RH')->from('[email protected]');
});
});
Could soemone help me?
2
Answers
It seems like a relatively new issue: https://github.com/laravel/framework/issues/53721
Which should be fixed in the next release.
In the meantime, you should manually upgrade the symfony/mailer package.
If the issue persists try changing the
MAIL_ENCRYPTION
which should automatically set thescheme
:As discussed in the issue: https://github.com/laravel/framework/issues/53721#issuecomment-2513369358
In my case a hint from Laracast forum solved it.
https://laracasts.com/discuss/channels/laravel/mailer-problem-scheme-is-not-supported-supported-schemes-for-mailer-smtp-are-smtp-smtps
They supposed to add
‘scheme’ => ‘smtp’
in config/mail.php in ‘mailers’=> ‘smtp’ section.