且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

mailto应该在HTML5中使用吗?

更新时间:2023-11-10 23:51:40

你应该在HTML4和HTML5中使用 mailto: URI方案

如果用户不想要邮件客户端加载,他不会点击链接。

不使用 mailto:只是让你发送电子邮件更加烦人。

You should use the mailto: URI scheme in both HTML4 and HTML5.
If the user doesn't want a mail client to load, he won't click the link.
Not using mailto: just makes it more annoying to send you email.

任何半不错(不雅?)垃圾邮件抓取工具都会收到电子邮件地址,无论他们是否在 mailto:

Any half-decent (indecent?) spam crawler will pick up email addresses whether or not they're in mailto:.

防止这种情况的一种有效方法是在Javascript中包含(通常)加密版本的电子邮件地址并将其写入文档。

这种方式,任何不执行Javascript的垃圾邮件爬虫将无法获取您的地址。

如果您害怕使用Javascript的垃圾邮件爬虫,您只能在mousemove和/或之后写下电子邮件地址秒。

出于可访问性原因,对于hu在禁用Javascript的情况下,您可能希望以纯文本格式包含加扰形式的地址。 (例如, SLaks(SHIFT + 2)MyDomain(句号)com

您可以编写服务器端脚本以自动为电子邮件生成此脚本地址。

One effective way to prevent this is to include a (trivially-)encrypted version of the email address in Javascript and write it into the document.
This way, any spam crawlers that do not execute Javascript won't get your address.
If you're afraid of spam crawlers that do use Javascript, you can only write the email address on mousemove and/or after 5 seconds.
For accesibility reasons, and for humans with Javascript disabled, you may want to include a scrambled form of the address in plain text. (eg, SLaks (SHIFT+2) MyDomain (period) com)
You can write a server-side script to generate this automatically for an email address.

出于显而易见的原因,我不会共享代码。 (为了使其运行良好,每个站点应该有不同的实现)

For obvious reasons, I won't share code. (In order for this to work well, each site should have a different implementation)