如何在 laravel 和 RollbarNotifier 中发送邮件
How send mail in laravel and RollbarNotifier
我开发了一个 laravel 应用程序,我想自动向用户发送带有剩余部分的电子邮件。
我创建了这样的命令 article。但我收到此错误:
[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>
config/mail.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'),
],
],
];
看起来你的依赖注入没有工作。它缺少一个配置文件。
我不确定您使用的是哪个软件包。但是当我在 https://github.com/jenssegers/laravel-rollbar 查看安装手册时,我发现您还必须在 services.php
:
添加一些配置
'rollbar' => [
'access_token' => env('ROLLBAR_TOKEN'),
'level' => env('ROLLBAR_LEVEL'),
],
我开发了一个 laravel 应用程序,我想自动向用户发送带有剩余部分的电子邮件。
我创建了这样的命令 article。但我收到此错误:
[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>
config/mail.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'),
],
],
];
看起来你的依赖注入没有工作。它缺少一个配置文件。
我不确定您使用的是哪个软件包。但是当我在 https://github.com/jenssegers/laravel-rollbar 查看安装手册时,我发现您还必须在 services.php
:
'rollbar' => [
'access_token' => env('ROLLBAR_TOKEN'),
'level' => env('ROLLBAR_LEVEL'),
],