I am stuck heavily with this problem
I got around 100 emails to send mails to.
I want am trying to create one message and add all emails into the setTo method
I have tried all but nothing works, below is my last attempt.
$list comes from a query.
foreach($list as $item) {
$name[] = $item->name; $email[] = "'".$item->email."'";
$id = 0;
$id = $id +1;
}
$message->setTo(array(implode(',',$email)));
Any ideas?
Well, better answer can be provided if you show the structure of
$listassuming the structure of$listis as you are using.See here for info how to add recipients in setTo method
http://swiftmailer.org/docs/recipients