I am using symfony 2.1 and I have form for adding e-mails (with table in Database).Something like Newsletter. And i want to send group email for all recipents from this table. How to put all this email`s from database table into setTo.
$message = \Swift_Message::newInstance()
->setSubject('Hello Email')
->setFrom('form@form.pl')
->setTo('??')
->setBody(
$this->renderView(
'NewAdminBundle:Msg:index.html.twig',
array('singlelist' => $list
)
)
)
;
$this->get('mailer')->send($message);