Why am I receiving same attachment twice with this code!?
$mailer = new Zend_Mail('UTF-8');
$mailer->setFrom($group_email,$group_name);
$mailer->setSubject($title);
$mailer->setBodyHtml($full);
$fileContents = file_get_contents('test.jpg');
$attachment = $mailer->createAttachment($fileContents);
$attachment->filename = "test.jpg";
$mailer->addAttachment($attachment);
//get all subscribers
$i=0;
foreach ($subscribers->getGroupUsers($group_id) as $sub){
if ($i==0){
$mailer->addTo($sub->email);
}
else {
$mailer->addBcc($sub->email);
}
$i++;
}
$mailer->send();