I have the following routine implemented in Laravel
$prestadores = \App\Prestador::all();
Mail::send('emails.listaprestadores',['prestadores' => $prestadores],
function($message) use ($prestadores){
$message->to('[email protected]', 'Marcelo Gomes');
$message->subject('[Teste] Lista de Prestadores');
});
The View
is the code below. It does not generate exception
, but the email is not sent.
I changed the routine to send a simple email and it is sent normally.
I think I'm doing something wrong while passing array
, but I took the example in the Laravel
documentation.
<!DOCTYPE html><html>
<head>
<title>Lista de Prestadores</title>
</head><body>
<table width="900" class="table table-responsive table-striped">
<thead>
<th>ID</th>
<th>Razão Social</th>
<th>CNPJ</th>
<th>Cidade</th>
</thead>
<tbody>
@foreach($prestadores as $prestador)
<tr>
<td>{{ $prestador->id ]}</td>
<td>{{ $prestador->rezao_social ]}</td>
<td>{{ $prestador->cnpj ]}</td>
<td>{{ $prestador->cidade ]}</td>
</tr>
@endforeach
</tbody>
</table><table class="table">
<tr>
<td><span class="small">TrabalhoEmDia.com - Suas tarefas em Dia - </span>/td>
</tr>
</table>
</body>
</html>