为什么我使用此代码两次收到相同的附件!?带附件的ZF邮件问题
$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();
你的答案对我帮助很大+ 1从我 – Rinzler 2012-10-17 06:22:10