给定[]的邮箱中的地址不符合RFC 2822,3.6.2

时间:2017-10-27 10:48:47

标签: laravel

给定[]的邮箱中的地址不符合RFC 2822,3.6.2 请检查我的查询:

foreach ($mail as $value ){
                $data['rec'] = json_decode(json_encode($value),true);
            }

                Mail::send(array('html' => 'mail'),  $data, function($message) use($data)
            {
                // print_r($email);
                $message->to($data->email);
            });

1 个答案:

答案 0 :(得分:0)

foreach ($mail as $value ){
                $data['rec'] = json_decode(json_encode($value),true);
                print_r($data['rec']['email']);
                Mail::send(array('html' => 'mail'),  $data, function($message) use($data)
                         {
                            <!-- print_r($data->email); -->
                          $message->to($data['rec']['email'])->subject($data['rec']['invoice']);
                        });

            }