org_heigl / contact
使用蜜罐进行垃圾邮件保护的联系表单
1.0.1
2017-02-18 19:00 UTC
Requires
- php: ^7.0
- zendframework/zend-form: ^2.1 || ^3.0
- zendframework/zend-hydrator: ^2.1 || ^3.0
- zendframework/zend-inputfilter: ^2.1 || ^3.0
- zendframework/zend-mail: ^2.1 || ^3.0
- zendframework/zend-math: ^2.1 || ^3.0
- zendframework/zend-mvc: ^2.1 || ^3.0
- zendframework/zend-servicemanager: ^2.1 || ^3.0
- zendframework/zend-session: ^2.1 || ^3.0
- zendframework/zend-stdlib: ^2.1 || ^3.0
- zendframework/zend-validator: ^2.1 || ^3.0
- zendframework/zend-view: ^2.1 || ^3.0
Requires (Dev)
- mockery/mockery: ^0.9
- phpunit/phpunit: ^6.0
This package is auto-updated.
Last update: 2024-09-23 09:57:05 UTC
README
此模块提供了一个简单的带蜜罐垃圾邮件保护的联系表单。它基于Matthew WeierOPhinney的PhlyContact-Module。
蜜罐的想法基于Lorna Jane Mitchell的一篇博客。
例如,联系表单在php.ughttps://php.ug/contact)上使用,到目前为止,我已经超过4年没有收到垃圾邮件。所以蜜罐似乎在起作用。 :)
安装
使用composer安装此包。
composer require org_heigl/contact
用法
- 在您的application.conf文件中将模块添加到模块列表中
return [ 'modules' => [ 'Org_Heigl\Contact', ] ]
- 通过复制文件
vendor/org_heigl/contact/config/module.org-heigl-contact.local.php.-dist
到您的应用程序的autoload
文件夹(移除路径中的.dist
)并修改内容来配置您的设置。
return [ 'OrgHeiglContact' => [ 'mail_transport' => [ // 'class' => 'Zend\Mail\Transport\Smtp', // 'options' => [ // 'host' => 'localhost', // 'port' => 587, // 'connectionClass' => 'login', // 'connectionConfig' => [ // 'ssl' => 'tls', // 'username' => 'contact@your.tld', // 'password' => 'password', // ], // ], 'class' => 'File', 'options' => array( 'path' => sys_get_temp_dir(), ], ], 'message' => [ // These can be either a string, or an array of email => name pairs 'to' => 'contact@your.tld', 'from' => 'contact@your.tld', // This should be an array with minimally an "address" element, and // can also contain a "name" element 'sender' => array( 'address' => 'contact@your.tld' ], ], ], ]
对于mail_transport
设置,您可能想查看Zend\Mail。
- 在视图中使用
$this->url('contact')
链接到表单。这将渲染视图中的表单。 - 没有第四步。