在 Lumen Framework 中通过 Mandrill 发送电子邮件

Send emails via Mandrill within Lumen Framework

我已经使用以下代码在配置目录 services.php 中创建了文件:

<?php
     return [
       'mandrill' => [
            'secret' => env('MANDRILL_SECRET'),
        ],
     ],
];

此外,依赖项 illuminate/mail (v.^6.3) 已添加到项目中。

但是,当我尝试使用这行代码发送电子邮件时

Mail::to($user->email)->send(new Welcome($user));

我看到一个错误:{"data":null,"errors":{"messages":"Driver [mandrill] not supported.","fields":[]}}

框架版本 - Lumen (6.0.2)(Laravel 组件 ^6.0)

this commit

取消了对 Mandrill 邮件服务的支持
Remove Mandrill and SparkPost mail drivers

We're removing these drivers because we feel that general interest in these is 
declining and these aren't used by any of Laravel's core services themselves. 
We're encouraging the community to release packages for these if there's any 
interest in continued use of them.

所以你必须安装第三方包来再次支持它 intonate/laravel-mandrill-driver

另请注意,它已从 the docs in 5.3 so you have to read the 5.2 docs for official info or the above package readme

中删除

希望对您有所帮助