org_heigl/contact

使用蜜罐进行垃圾邮件保护的联系表单

1.0.1 2017-02-18 19:00 UTC

This package is auto-updated.

Last update: 2024-09-23 09:57:05 UTC


README

Build-Status Coverage Status Scrutinizer Code Quality Code Climate Codacy Badge SensioLabsInsight

Latest Stable Version Total Downloads License composer.lock

此模块提供了一个简单的带蜜罐垃圾邮件保护的联系表单。它基于Matthew WeierOPhinney的PhlyContact-Module

蜜罐的想法基于Lorna Jane Mitchell的一篇博客

例如,联系表单在php.ughttps://php.ug/contact)上使用,到目前为止,我已经超过4年没有收到垃圾邮件。所以蜜罐似乎在起作用。 :)

安装

使用composer安装此包。

    composer require org_heigl/contact

用法

  1. 在您的application.conf文件中将模块添加到模块列表中
    return [
         'modules' => [
             'Org_Heigl\Contact',
         ]
    ]
  1. 通过复制文件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

  1. 在视图中使用$this->url('contact')链接到表单。这将渲染视图中的表单。
  2. 没有第四步。