如何在网站上显示电子邮件地址以避免垃圾邮件? [英] How to show email addresses on the website to avoid spams?

查看:269
本文介绍了如何在网站上显示电子邮件地址以避免垃圾邮件?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在我的网站上显示邮件如下

I show email on my website as following

 <a href="mailto:inf@example.com">Email</a>

但是,使用woorank.com分析我的网站时,我阅读了以下内容,我应该怎么做才能避免?

But I read the following while analysing my website using woorank.com, what should I do to avoid this?

Malicious bots scrape the web in search of email addresses and plain text email addresses are more likely to be spammed.


推荐答案

在网站上隐藏电子邮件有多种不同的选择,通常使用电子邮件地址的HTML实体版本(如Aziz-Saleh所建议的),但是从实际的网络设计角度来看,只需将这样的电子邮件地址放在网站上即可最便于使用的功能。

There are multiple different choices for hiding emails on websites, commonly using either the HTML entity version of the email address (as Aziz-Saleh suggested), but from an actual web design point of view, just putting the email address like that on a website isn't the most user friendly thing to do.

例如, mailto:链接会自动触发浏览器打开用户的电子邮件应用的选择 - 但考虑这一点。不是每个人都有专用的电子邮件应用程序。例如,我不使用Outlook(我是Windows用户),除非我安装了Windows Live Mail,否则我的电脑无法打开该链接。我认为如果您登录,Chrome可以打开到GMail的链接,但是我需要检查。

For instance, the mailto: link automatically triggers the browser to open the user's Email Application of choice - but consider this. Not everybody has a dedicated email application. For instance, I don't use Outlook (I'm a Windows user), and unless I have Windows Live Mail installed, my computer can't open that link. I think Chrome can open the links into GMail if you're signed in, but I would need to check that.

最终,通过使用 mailto:,您可能会疏远您的用户群的一部分,首先无法使用该链接。

Ultimately, by using mailto:, you are potentially alienating a portion of your userbase that will not be able to use that link in the first place.

我建议使用电子邮件表单,并且有很多易于理解的教程可用于PHP和您的语言 JSP ,例如此链接:在JSP中发送电子邮件甚至 StackOverflow

I would suggest using email forms, and there are plenty of easy-to-follow tutorials available for both PHP and your language of JSP, such as this link here: Sending Email in JSP and even on StackOverflow

通过使用您的服务器发送电子邮件,您可以更严格地控​​制电子邮件的生成方式,用户可以输入哪些数据,甚至可以向他们发送回邮件(由服务器)确认您已收到他们的消息。这是经过验证的真实世界,允许客户和访客与您联系,同时仍然为您提供保护和控制整个过程。

By using your server to send the email, you get tighter control over how the email is generated, what data the user is allowed to put in, and you could even send them a return email (generated by the server) to confirm that you have received their message. This is a tried-and-tested real-world method of allowing customers and visitors to contact you, whilst still giving you protection and control over the entire process.

TL; DR :Raw mailto:链接可能会疏远没有专用电子邮件程序的人,而如果您使用JSP表单,则可以控制他们如何与您联系什么信息(您可以使用字段和HTML5 属性来确定某些输入字段),甚至可以使用 do-not-reply 电子邮件,所以他们知道他们的消息被听到(只是不要忘记要求他们的电子邮件地址)

TL;DR: Raw mailto: links might alienate people without dedicated email programs, whereas if you use JSP forms, you can control how they contact you, with what information (you can use fields and the HTML5 required attribute to mandate certain input fields) and you can even respond with a do-not-reply email so they know their message was heard (just don't forget to ask for their email address)

这篇关于如何在网站上显示电子邮件地址以避免垃圾邮件?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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