电子邮件没有被发送Laravel

时间:2017-09-25 11:17:55

标签: laravel laravel-5 laravel-5.4

在控制器中(maildata和query_string是数组并被发送):

$this->dispatch(new SendBulkRegisterEmail($maildata,$query_string));

在SendBulkRegisterEmail

public $query_string, $maildata;

    public function __construct($maildata, $query_string)
    {
        $this->query_string = $query_string;
        $this->maildata = $maildata;
    }

    /**
     * Execute the job.
     *
     * @return void
     */
    public function handle()
    {
        try{
            for ($i=0; $i < count($this->maildata) ; $i++) {
                $mailers = $maildata[$i];
                Mail::send('mails.new_user_mail', $mailers, function($message)  use ($mailers)
                {
                    $message->to($mailers["toemail"],$mailers['studentname'])->subject($mailers['subject']);
                });
            }
        }catch(Exception $e){
        }
    }

邮件未发送。有人请帮忙 在此先感谢

0 个答案:

没有答案