The correct email text format for the website

I need to display my email address on my website and I use this email format [at] domain.com for anti-spam purposes, but one of my colleagues told me to use this instead of email@domain.com so that the visitor can easily copy the address and paste it into the mail application. And I see that some websites also use the image for their email address. So what could be the best way to do this?

email [at] domain.com , email@domain.com or use the image as follows: enter image description here

Thanks.

+1
source share
2 answers

There are several ways to display your email data. For advanced thought you can also use a QR code. In the question that you asked, it relates to the fact that using email in the wwxx@example.com format is fraught with risk, as spam bots catch it from the html DOM.

You can use some scripts like this for protection.

<span id="email">email[at]domain.com</span> <!-- Please enter a valid email address --> <SCRIPT TYPE="text/javascript"> var emailE='emailserver.com' var emailE=('yourname' + '@' + emailE) var emailAttr = document.getElementById("email"); document.getElementById("email").innerHTML ='<a href="mailto:' + emailE + '">' + emailE + '</a>'; //--> </script> 

There are also some encoding methods that you could adapt.

+1
source

The right way? Make a URI (using the mailto URI mailto ) and bind it (using the a element of HTML).

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

The best way? Depends on your criteria.

If you want to make the life of your visitors (including people, as well as bots) easier , use the link.
If you want to make the lives of your visitors (including people, as well as bots) more difficult , obfuscate the address.

“Harder” can also mean impossibility, depending on how you confuse. Many blind users will not be able to access your email address if you post it as an image. Some users with intellectual disabilities will not be able to exchange [at] for @ . Users without the copy-paste function may not remember your address when switching applications and the need to enter it manually. Users without JavaScript may not have access to some smart widgets. And so on.

+1
source

Source: https://habr.com/ru/post/1239546/


All Articles