【问题标题】:batch email send with response批量发送电子邮件并回复
【发布时间】:2010-07-18 20:10:49
【问题描述】:
【问题讨论】:
标签:
phpmailer
mailing-list
swiftmailer
【解决方案1】:
那里的说明中有另一个页面讨论了batchsend()失败http://swiftmailer.org/docs/finding-failures,还有一个example,我怀疑batchsend将以完全相同的方式完成。。 p>
$mailer = Swift_Mailer::newInstance( ... );
$message = Swift_Message::newInstance( ... )
->setFrom( ... )
->setTo(array(
'receiver@bad-domain.org' => 'Receiver Name',
'other@domain.org' => 'A name',
'other-receiver@bad-domain.org' => 'Other Name'
))
->setBody( ... )
;
//Pass a variable name to the send() method
if (!$mailer->send($message, $failures))
{
echo "Failures:";
print_r($failures);
}
/*
Failures:
Array (
0 => receiver@bad-domain.org,
1 => other-receiver@bad-domain.org
)
*/