Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/laravel/10.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在不执行php artisan queue:listen的情况下使用队列发送邮件?_Php_Laravel_Email_Terminal_Queue - Fatal编程技术网

如何在不执行php artisan queue:listen的情况下使用队列发送邮件?

如何在不执行php artisan queue:listen的情况下使用队列发送邮件?,php,laravel,email,terminal,queue,Php,Laravel,Email,Terminal,Queue,我在orderController中有一个功能,可以向所有卖家发送有关新订单的电子邮件: public function sendMailToSellers($order, $orderDetails) { $sellers = Role::with('users')->where('name', 'seller')->get()->first()->users->toArray(); $emails = [];

我在orderController中有一个功能,可以向所有卖家发送有关新订单的电子邮件:

public function sendMailToSellers($order, $orderDetails)
    {

        $sellers = Role::with('users')->where('name', 'seller')->get()->first()->users->toArray();
        $emails = [];
        foreach ($sellers as $seller) {
            $emails[] = $seller['email'];
        }


        Mail::queue(green.'.orderEmail', ['order_details' => $orderDetails, 'order' => $order], function ($message) use ($emails, $order) {
            $message->from('myMail@gmail.com', 'MyShop');
            $message->bcc($emails);
            $message->subject('New order №' . $order['order_id'].' '. $order['created_at']);
        });

    }

但问题是,只有在终端php artisan队列中运行时,电子邮件才会发送:listen。我试图运行nohup-php-artisan-queue:listen,但终端告诉我nohup不存在:c

你认识主管吗?看一看:它是针对linux的,我有Windows,所以试着使用
cron
:你知道
supervisor
?看一看:它是针对linux的,我有Windows,所以请尝试使用
cron