openbuildings / swiftmailer-filter
从域名或电子邮件中为电子邮件发送设置白名单/黑名单
0.4.0
2020-02-14 09:56 UTC
Requires
- php: ^7.1
Requires (Dev)
- phpunit/phpunit: ^7
- swiftmailer/swiftmailer: ^5.0.0
This package is auto-updated.
Last update: 2024-09-17 18:01:18 UTC
README
这是一个swiftmailer插件,允许设置白名单/黑名单以决定哪些电子邮件可以发送。例如,当您只想在测试/预演环境中允许发送到特定域名时,这非常有用。
用法
$mailer = Swift_Mailer::newInstance(); $mailer->registerPLugin(new FilterPlugin([ new WhiteListFilter(['example.com']), new BlacklistFilter(['test4@example.com, test5@example.com']) ]));
第一个参数是白名单过滤器,第二个是黑名单过滤器,它们都允许数组形式的电子邮件或域名。如果您指定了一个域名,则该域名的所有电子邮件都将被添加到白名单/黑名单中。
许可证
版权(c)2015,Clippings Ltd。由Ivan Kerin开发,作为clippings.com的一部分。
在BSD-3-Clause许可证下,请参阅LICENSE文件。