-3
Hello.
I have a query (SQLSRV) that brings me a list of clients with expired financial securities. I have to send an e-mail (PHPMAILER) to each one with their outstanding expired securities. As I am doing, I can send an email to each line, so following the table below, I am expected to send ONE email to client1 with the two values of the same, and an email to cliente2 with the two values of the same.
How I would handle this case ?
Client | Valor |
---|---|
cliente1 | valor1 |
cliente1 | value2 |
cliente2 | Valor3 |
cliente2 | value4 |
Output of query values:
$vencimentos = $query->fetchAll();
$content =
'<table>
<thead>
<tr>
<th>Nro. Nota</th>
<th>Nome</th>
<th>Emissão</th>
<th>Parcela</th>
<th>Valor</th>
</tr>
</thead>
<tbody>';
foreach($vencimentos as $v){
$name = $v["A1_NOME"];
$email = $v["A1_EMAIL"];
$content .=
'<tr>
<td>'.$v["E1_NUM"].'</td>
<td>'.$v["A1_NOME"].'</td>
<td>'.$v["E1_EMISSAO"].'</td>
<td>'.$v["E1_PARCELA"].'</td>
<td>'.number_format($v["E1_VALOR"], 2, ",", "") .'</td>
</tr>';
}
$content .= '</tbody></table>';
echo $content;
die;
Hello Daniel, I did exactly as your tip in the example and it worked super well, thanks for the help.
– Caique Oliveira