我开发了一个 laravel 应用程序,我想自动将剩余的电子邮件发送给用户。
我像本文一样创建了命令。但我得到这个错误:
[Illuminate\Contracts\Container\BindingResolutionException]
Unresolvable dependency resolving [Parameter #0 [ <required> $config ]] in
class RollbarNotifier
这是我的代码:
.env
MAIL_DRIVER=smtp
MAIL_HOST=example.com
MAIL_PORT=465
MAIL_USERNAME=noreply@example.com
MAIL_PASSWORD=PAssWord
MAIL_ENCRYPTION=SSL
MAIL_FROM_ADDRESS=noreply@example.com
MAIL_FROM_NAME="FROM FROM"
ROLLBAR_TOKEN=<my_token>
配置/邮件.php
<?php
return [
'driver' => env('MAIL_DRIVER', 'smtp'),
'host' => env('MAIL_HOST', 'example.com'),
'port' => env('MAIL_PORT', 465),
'from' => [
'address' => env('MAIL_FROM_ADDRESS', 'noreply@example.com'),
'name' => env('MAIL_FROM_NAME', 'FROM FROM'),
],
'encryption' => env('MAIL_ENCRYPTION', 'SSL'),
'username' => env('MAIL_USERNAME'),
'password' => env('MAIL_PASSWORD'),
'sendmail' => '/usr/sbin/sendmail -bs',
'markdown' => [
'theme' => 'default',
'paths' => [
resource_path('views/vendor/mail'),
],
],
];