Creating a batch list

Swift Mailer is a fantastic library for sending email with php. Discuss this library or ask any questions about it here.

Moderators: Chris Corbyn, General Moderators

Post Reply
tgavin
Forum Newbie
Posts: 15
Joined: Sun Aug 26, 2007 3:13 pm

Creating a batch list

Post by tgavin »

I'm trying to set up 4.0.3 and am having difficulty creating the batch email list. Here's what I'm trying to do

Code: Select all

for($i=0;$i<count($toEmail);$i++){
    $to .= $toEmail[$i].',';
}
$to = rtrim($to,',');
 
// Create the message
$message = Swift_Message::newInstance('Wonderful Subject')
    ->setFrom(array('do-not-reply@domain.com' => 'administrator'))
    ->setTo(array($to))
    ->setBody('I thought you might like this!','text/html')
;
Obviously this doesn't work. What can I do to build that array?
Post Reply