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

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

问题描述

过去几天我一直在更新我的个人网站.我个人网站的网址是(我的名字).(我的姓氏).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" />

这不太理想,因为访问者不仅无法点击它向我发送电子邮件,而且更聪明的垃圾邮件机器人可能能够检测到图像包含的字符.

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,因为我的网站已经使用了大量 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天全站免登陆