Home > Tips > Unspammable Email Link

Unspammable Email Link

September 30th, 2009 Leave a comment Go to comments

Ever wondered how those sneaky spammers got your email address. Well they use robots to scan the internet and pick up email addresses off web pages. So if you ever publish your email address on a web page, sooner or later (most likely sooner), you’ll find you Inbox filling up with spam. There is however another way.

Using the following piece of script, you can dynamically write your email address onto the page. It still creates a link, yet spammers robots can’t read it. Brilliant.

To use simply insert the script into the HTML code of your web page and change to reflect your email address.

<script language=”JavaScript”><!–
var name = “name”;
var domain = “domain.com”;
document.write(‘<a href=\”mailto:’ + name + ‘@’ + domain + ‘\“>’);
document.write(‘TEXT TO DISPLAY ON WEBPAGE’ + ‘</a>’);
// –></script>

Or use this one to display the address as the email link.

<script language=”JavaScript”><!–
var name = “name”;
var domain = “domain.com”;
document.write(‘<a href=\”mailto:’ + name + ‘@’ + domain + ‘\“>’);
document.write(name + ‘@’ + domain+'</a>’);
// –></script>

Originally taken from http://www.javascriptkit.com/script/script2/unspam.shtml

Share
Categories: Tips Tags: , , ,
  1. No comments yet.
  1. No trackbacks yet.