Spam-Proof email address generator information

Spam-Proof Email Address Generator - Info

How the email address generator works

NOTE: In the following examples we use as the example email address we are trying to protect. Due to the nature of the examples, by putting the address in this code unprotected it is likely to generate spam and so any email to this address will get put into our Hall of Shame and be ignored!

If you write websites then you'll probably recognise the following code:

Click <a href="">here</a> to email me

A web browser would display this as follows:

Click here to email me

Unfortunately, code like this is very easy to scan through looking for email addresses to send spam to. The "mailto:" bit is a dead give-away, and even without that string of numbers, letters and dots which contains an "@" symbol is probably an address.

One way to get around this, and the method we use, is to use the "JavaScript" functionality built into almost all web browsers to convert something far less obvious into an email address. The spam-proof email address generator would turn the above email address into something more like this:

Click <SCRIPT language="javascript"> eval(unescape( '%64%6f%63%75%6d%65%6e%74%2e%77%72%69%74%65%28%27%3c%61%20%68%72%65%66%3d%22%6d%61%69%6c%74%6f%3a%73%70%61%6d%2d%6d%65%40%71%75%61%72%65%6c%6c%61%2e%63%6f%2e%75%6b%22%3e%68%65%72%65%3c%2f%61%3e%27%29%3b' ))</SCRIPT> to email me.

Although this looks like garbage to most humans, your web browser can understand it and would display it as follows:

Click to email me.

.. which as you can see looks the same as the first version (and works the same) but is nowhere near as simple to interpret.

It isn't completely foolproof, but since the main keys to search for have vanished (the "@" symbol and the "mailto:") it takes a lot more work to find and interpret this into an email address.

Another disadvantage is that browsers which do not understand JavaScript will not be able to display the address. This ought not cause a big problem, since almost all browsers in normal use do support JavaScript (and many many sites already rely on it for other things). However, to be on the safe side the code generator (optionally) adds code to display a help page for the very few people affected by the JavaScript code - you can see an example of how that looks here.

The spam-proof email address generator has a number of extra features:

  • You can choose the text (the word "here" in the examples above) which acts as the link, or else you can leave it blank to use the email address itself.
  • You can add an optional Email Subject which will become the subject of the email that gets sent when visitors to your site click on the email link (unless the sender changes it).
  • You can add CC ("carbon copy") and BCC ("blind carbon copy") addresses as well if you need the email to be sent to more than one place (most people should leave these blank).