我正在尝试为我的laravel应用程序创建电子邮件验证。为此我已经用这个内容设置了一份新工作:
class SendVerificationEmail implements ShouldQueue
{
use Dispatchable, InteractsWithQueue, Queueable, SerializesModels;
protected $user;
public function __construct($user)
{
$this->user = $user;
}
public function handle()
{
$email = new EmailVerification($this->user);
Mail::to($this->user->email)->send($email);
}
}
此剂量不起作用。如果我运行php artisan queue:work
并执行该作业,控制台会在无限循环中告诉我:
[2018-03-26 15:50:25][1] Processing: App\Jobs\SendVerificationEmail
[2018-03-26 15:50:26][2] Processing: App\Jobs\SendVerificationEmail
[2018-03-26 15:50:26][3] Processing: App\Jobs\SendVerificationEmail
[2018-03-26 15:50:26][...] Processing: App\Jobs\SendVerificationEmail
出了什么问题?我的SMTP设置是最新的。