I'm starting an email system for a client. It has SMTP from locaweb and they have an API for sending mail. So far so good I can send the emails using their api, but I came across a question that I can not solve.
It's like this: I need to mount an array with the email, but the emails are in the database, so how do I loop the replay inside the array?
$to = array(
'[email protected]',
'[email protected]',
'[email protected]',
'[email protected]',
)
I tried this way:
$to = array(
foreach ($query as $row):
echo '"'. $row->email . '",'
endforeach;
)
But without success how can I solve this. Can someone give me a light?