mailto应该在HTML5中使用吗? [英] Should mailto be used in HTML5?

查看:152
本文介绍了mailto应该在HTML5中使用吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

大约一年前,我决定停止使用mailto标签,因为很多时候它对用户来说很烦人。它将显示用户当时可能没有使用的电子邮件程序,这可能也需要一段时间来加载,并且可能不是用户在他/她点击看起来像链接时想要做的事情。

A year or so ago I decided to stop using the mailto tag because many times it is annoying to the user. It will bring up an email program that the user may not be using at the time, which may also take time to load and may not be what the user wanted to do when he/she clicked on what looked like a link.

相反,我决定开始显示没有mailto标签的电子邮件地址。我相信这两种方式都可能产生垃圾邮件。

Instead I decided to just start displaying the email address without the mailto tag. I believe that both ways probably can produce spam.

我的问题是,mailto标签是设置电子邮件链接的可接受方式,还是做好人/公司避免它们?其次,如果他们都创建垃圾邮件,有没有办法阻止垃圾邮件生成?我已经看到mailto以某种方式放在评论中,但它似乎是一种被黑客攻击的方式。

My questions are these, Is the mailto tag the accepted way to setup email links, or do good people/companies avoid them? Second, if they both create spam, is there a way to prevent spam from being generated on either? I have seen the mailto being put inside comments somehow, but it seems kind of a hacked way of doing it.

推荐答案

你应该在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)

这篇关于mailto应该在HTML5中使用吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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