2
I am starting an email sending system for a customer. It has SMTP from Locaweb and they have an API for sending email. So far so good I can send the emails using their api, but I came across a question that I am not able to solve.
Here’s the thing: I need to assemble an array with the emails, but the emails are in the database, so how can I loop the loop inside the array?
$to = array(
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
)
I tried so:
$to = array(
foreach ($query as $row):
echo '"'. $row->email . '",'
endforeach;
)
But unsuccessfully how can I resolve this. Can anyone give me a light?
you want to send an email to several people in the field
para/to
email? which library is using to send email?– rray
If you search the data with PDO and use Fetchassoc it automatically brings an Array
– KhaosDoctor