org_heigl / mailproxy
显示可点击的电子邮件地址而不被垃圾邮件垃圾邮件
2.0.0
2017-02-22 06:49 UTC
Requires
- php: ^7.0
- zendframework/zend-modulemanager: ^2.7
- zendframework/zend-mvc: ^3.0
- zendframework/zend-uri: ^2.5
- zendframework/zend-view: ^2.8
Requires (Dev)
- mockery/mockery: ^0.9.8
- phpunit/phpunit: ^6.0
- dev-master
- 2.0.0
- 1.0.0
- dev-dependabot/composer/mockery/mockery-1.3.6
- dev-dependabot/add-v2-config-file
- dev-dependabot/composer/mockery/mockery-1.3.4
- dev-dependabot/composer/zendframework/zend-mvc-3.1.1
- dev-dependabot/composer/zendframework/zend-http-2.11.2
- dev-dependabot/composer/zendframework/zend-view-2.11.4
- dev-dependabot/composer/zendframework/zend-modulemanager-2.8.4
- dev-dependabot/composer/zendframework/zend-uri-2.7.1
- dev-dependabot/composer/phpunit/phpunit-6.5.14
- dev-phpug
This package is auto-updated.
Last update: 2024-09-08 08:39:32 UTC
README
Org_Heigl\Mailproxy
这个Zend-Framework模块允许使用混淆的电子邮件地址创建mailto链接。
提供的电子邮件地址将简单地通过反转它来混淆。使用CSS,电子邮件地址在默认的HTML输出中将完美可读,但抓取网站的机器人将简单地看到一个“反转”的电子邮件地址或一些垃圾。
点击链接后,反转的电子邮件地址将被发送到一个代理,该代理将浏览器重定向到包含正确电子邮件地址的mailto-url。
安装
最好使用 composer 安装此模块。
composer require org_heigl/mailproxy
使用方法
-
在您的application.conf文件中将该模块添加到模块列表中,如下所示
return [ 'modules' => [ … 'Org_Heigl\Mailproxy'. … ] ];
-
在您的视图脚本中,您可以将以下代码片段添加到创建mailto链接到地址 info@example.com
<?php echo $this->mailto('info@example.com', 'Send me an Email', ['class' => 'myClass', 'title' => 'click me']);
第二个参数是可选的,其内容将被设置为链接名称(和之间的内容)。如果省略,电子邮件地址将以一种难以让机器人以纯文本形式检索的方式给出。
第三个参数也是可选的。它可以是带有进一步属性的关联数组的锚标签。如果您想设置第三个参数但省略第二个,请将第二个参数传递为“null”。
经验
该模块已在php.ug上运行了4年,并且我没有收到任何通过该模块显示的电子邮件地址的垃圾邮件。