FakeTP

Visit our advertisers! In 2006-2007 I barely had revenue to cover the $9 domain registration!


Tools/Code:

Don't want to donate? Then at least visit our advertisers' links!

I barely get enough revenue to cover the annual $9 domain registration!

SafeMail

One way spammers get your email address is with programs written to extract addresses from web pages. These robots, as they are called, look for mailto: links in the body of web pages. A good way to protect your email address from spammer lists created in this way is keep your email address off web pages. But what if you want people to have your email address? This script, SafeMail, solves that problem for you.

SafeMail lets you put your address on the page using javascript's document.write() method. With this, your user's browser displays your email link exactly as if you had coded it with HTML, except you can achieve this effect without at any point putting the string of your email address in the code. This means spambots find nothing, and you stay clear of spam. All the code you need to use SafeMail can be copied directly from this pae, though you can also download an example of the files that describe and create this effect..

There are three steps required to get this effect:

  1. Store the safemail.js script online
  2. Call the safemail.js script from your web page
  3. Call the safemail() function with the proper parameters

Store the script online

You need to save safemail.js on your web server, probably in your root directory so that it can be called most conveniently. The script takes three parameters, these being the display name, the username, and the domain name. This is the script:

Call the script from your page

On the web page that is going to be displaying the email address, you need to call this safemail.js script. This is best done in the <head> section of your code. Your call to the script will be similar to this:

At this point, you may want to test that the script was placed in the proper directory by browsing to http://your-server.com/safemail.js.

Call the function and display the email link

You can now safely display as many email addresses as you desire on your page. If you want to link a display name to an address such as for , you would do it like this:

If you want to display the email address on the web page such as for , you need to do a simpler call to the function:

You may be very smart and realize that you can do this in only two steps if you do not do the first step described above in which you are told to store the script on your own web site. You may realized that you can have your pages call the script from another website such as this one that uses the script already. If you are really smart, then you realize this is a bad idea. The problem with relying on another person's site to have this script for you is that if that site goes away, all your email links with disappear because the function writing them to the page is not available. Some people will still want call the script from http://www.faketp.com/safemail.js. This is not a good idea because this site periodically changes the name of this script. Don't do it. It is not polite to use someone else's resources without permission. Feel free to copy this script to your own site.

Compatibility

This script does not work as described above for very, very old browsers. If your user has Netscape 3, Explorer 3, or earlier browsers, then external javascripts cannot be included. The internet.com network of web sites reports at the time of this writing that of the nearly one billion visits it gets each month, only .63% are using these old browsers.

The content of this page to this point was written Feb 25, 2002. Three years later, Mar 10, 2005, I had a person ask me whether there isn't a bug with one of the newer browsers and this script. Please let me know if you find this to be the case. I've tested it with Firefox 1.0.1, Netscape 7.1, Opera 7.3, and Internet Explorer 6.0. In every case, I find no issues. Please tell me if you find otherwise.

Using Safemail With Images

Over the years, the most popular question about SafeMail has been whether it can be used to make an image a link to the protected email address. Yes, it can. To do so, give the HTML for your image as the display instead of giving text for the display. An example then: to write our friend Joe Blow again, a true dog lover:

The clickable result:

Using Safemail with Dynamic Languages like PHP

You may want to use Safemail in a case where you don't know in advance what the address needs to be. For example, you might have a guestbook where your friends sign in. You then may put their addresses into a database, and you want to display links to these addresses without putting them at risk of being scraped by spambots. In such a case, you can write code to dynamically parse the address, then display it dynamically. For example:
The result of that would be the familiar safemail() function:
 

Sigh. Bad dentist. zahra hakim zahra hakim zahra hakim zahra hakim zahra hakim zahra hakim zahra hakim zahra hakim zahra hakim zahra hakim zahra hakim