What is the error?
Sep 9, 2015
3
Level 1
Address in mailbox given [] does not comply with RFC 2822, 3.6.2.
My QuizzesController:
public function getQuiz($id) { $quiz = $this->quiz->getQuiz($id); if(!$quiz) { return Response::json(['response' => 'Item nao encontrado!'], 400); } return Response::json($quiz, 200); }
public function allQuiz()
{
return Response::json($this->quiz->allQuiz(), 200);
}
public function saveQuiz()
{
return Response::json($this->quiz->saveQuiz(), 200);
}
public function sendMail()
{
$input = Input::all();
$quiz = $this->quiz->getModel()->findOrFail($input['id']);
$player = $quiz->player;
Mail::send('emails.welcome', ['key' => 'value'], function($message) use ($player)
{
$message->to($player->email, $player->name)->subject('Parabéns você jogou o Quiz do Nutrição em Jogo! Nosso novo encontro será na semana que vem.');
});
}
}
My Routes:
//Webservices Quiz
Route::group(['prefix' => 'api2'], function()
{
Route::group(['prefix' => 'quiz'], function()
{
Route::get('', ['uses' => 'Admin\QuizzesController@allQuiz']);
Route::get('{id}', ['uses' => 'Admin\QuizzesController@getQuiz']);
Route::post('', ['uses' => 'Admin\QuizzesController@saveQuiz']);
Route::post('mail', ['uses' => 'Admin\QuizzesController@sendMail']);
});
I want to send an email to the player_id but when sending got this error
Please or to participate in this conversation.