使用Swift Mailer AntiFlood插件或Throttler插件与Symfony 1.3

时间:2009-11-26 02:55:16

标签: php symfony1

在Symfony 1.3中使用Swift Mailer插件的语法是什么?

不是:

$email = $this->getMailer()->compose();
$email->setSubject($subject);
$email->setFrom($from);
$email->setTo($to);
$email->setBody($body, 'text/html');
$email->addPart($plain, 'text/plain');
$email->registerPlugin(new Swift_Plugins_AntiFloodPlugin(100, 30));
$email->registerPlugin(new Swift_Plugins_ThrottlerPlugin(100, Swift_Plugins_ThrottlerPlugin::MESSAGES_PER_MINUTE));

1 个答案:

答案 0 :(得分:1)

你试过了吗?

$this->getMailer()->getRealtimeTransport()->registerPlugin($pluginInstance);

OR:

$this->getMailer()->registerPlugin($pluginInstance);