在网站上模糊电子邮件地址的最佳方法? [英] Best way to obfuscate an e-mail address on a website?

查看:270
本文介绍了在网站上模糊电子邮件地址的最佳方法?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

过去几天,我花了几天时间更新我的个人网站。我的个人网站的URL是(我的名字)(我的姓氏).com,因为我的姓氏是非常不寻常的,我很幸运地拿起了域名。我的电子邮件地址是(我的名字)@(我的姓氏).com。所以真的,当它来猜测它,这不是很难。

I've spent the past few days working on updating my personal website. The URL of my personal website is (my first name).(my last name).com, as my last name is rather unusual, and I was lucky enough to pick up the domain name. My e-mail address is (my first name)@(my last name).com. So really, when it comes down to guessing it, it's not very hard.

无论如何,我想将一个mailto:链接到我的网站,所以人们可以联系我。而且,尽管我的电子邮件地址不是很难猜到,我宁可不用垃圾邮件机器人收集,只是抓取网站的电子邮件地址模式,并将其添加到他们的数据库。

Anyways, I want to integrate a mailto: link into my website, so people can contact me. And, despite my e-mail address not being very hard to guess, I'd rather not have it harvested by spam bots that just crawl websites for e-mail address patterns and add them to their database.

我最好的方式是混淆我的电子邮件地址,最好是链接形式?我知道的方法是:

What is the best way for me to obfuscate my e-mail address, preferably in link form? The methods I know of are:

<a href="mailto:x@y.com">e-mail me</a>

它的工作原理,但这也意味着,一旦我的网站登录Google,我会参与通过垃圾邮件,垃圾邮件机器人很容易挑出我的电子邮件地址。

It works, but it also means that as soon as my website hits Google, I'll be wading through spam as spam bots easily pick out my e-mail address.

<img src="images/e-mail.png" />

这不太可取,因为不仅访客无法点击它向我发送e - 邮件,但更智能的垃圾邮件机器人可能会检测到图像包含的字符。

This is less desirable, because not only will visitors be unable to click on it to send me an e-mail, but smarter spam bots will probably be able to detect the characters that the image contains.

我知道可能没有完美的解决方案,但我只是想知道大家认为最好的我绝对愿意在必要时使用JavaScript,因为我的网站已经使用了很多吨。

I know that there is probably no perfect solution, but I was just wondering what everyone thought was best. I'm definitely willing to use JavaScript if necessary, as my website already makes use of tons of it.

推荐答案

字符为HTML实体(类似于此)。它不需要启用JS,似乎已经停止了大部分的垃圾邮件。我想一个聪明的机器人仍然可以收获它,但我没有任何问题。

I encode the characters as HTML entities (something like this). It doesn't require JS to be enabled and seems to have stopped most of the spam. I suppose a smart bot might still harvest it, but I haven't had any problems.

这篇关于在网站上模糊电子邮件地址的最佳方法?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆