Print Page | Close Window

Javascript Code that Prevents Spam

Printed From: Web Wiz Forums
Category: General Discussion
Forum Name: General Discussion
Forum Description: General discussion and chat on any topic.
URL: https://forums.webwiz.net/forum_posts.asp?TID=12290
Printed Date: 28 March 2026 at 2:25am
Software Version: Web Wiz Forums 12.08 - https://www.webwizforums.com


Topic: Javascript Code that Prevents Spam
Posted By: Misty
Subject: Javascript Code that Prevents Spam
Date Posted: 23 October 2004 at 1:09am

I have the following Javascript code on some of my web pages:

<SCRIPT LANGUAGE="JavaScript">
<!-- This script and many more are available free online at -->
<!-- The JavaScript Source!! http://javascript.internet.com - http://javascript.internet.com -->
<!-- Original:  William Rozell Jr  -->
<!-- Web Site:  http://www.elranzer.com - http://www.elranzer.com -->

<!-- Begin

var user;

var domain;

var suffix;

function jemail(user, domain, suffix){

document.write('<a href="' + 'mailto:' + user + mailto:'@' - '@' + domain + '.' + suffix + '">' + user + mailto:'@' - '@' + domain + '.' + suffix + '</a>');

}

//-->

//  End -->

</script>

<SCRIPT LANGUAGE="JavaScript">

<!-- This script and many more are available free online at -->

<!-- The JavaScript Source!! http://javascript.internet.com - http://javascript.internet.com -->

<!-- Begin

jemail("info", "anywhere", "com");

//  End -->

</script>

Do you think it really prevent people from getting junk emails? I get a lot of junk emails. :(  Does anyone know how effective the above code is?




Replies:
Posted By: dpyers
Date Posted: 23 October 2004 at 2:21am

Run the page in a Lynx browser. If you can read an email address in Lynx, so can a spambot. Some people urlencode the mailto:@xx.yy.com - mailto:@xx.yy.com , but I think some spambots check for the url encoding.

Here's an alternative method I haven't tried.
http://jamesthornton.com/software/redirect-mailto.html - http://jamesthornton.com/software/redirect-mailto.html

Never had spam come in for a mail address that was used in a form action script.

Couple of things... spammers never retire an email address, so hiding an existing one is of little value. I have an email address that has not been published anywhere since 1991 - before graphical browsers were developed. I get about 40 spams a month to it - keep it around just to count the spam - lol.

I pay my registrar $1/year/domain to hide contact details including email adress from whois searches. They create an email address for the contact info that changes every xx days. They reject any non-domain/icann related email and forward valid mail to an address I gave them.
This protects against casual queries, but if a spammer is energetic enough to do a dns scan for the domain on your name servers, they can still get a valid email address - Run goawaynow.com into http://www.domainwhitepages.com/ - http://www.domainwhitepages.com/  to see what I mean.

Also, never use a catch-all email acount. Mail sent to an account that doesn't exist will then kick-back. Valid senders will see it and try again after checking the address. You won't miss any email if you don't have a catchall account.

Note: - Per ICANN, you have to have a mailto:postmaster@xxx.yyy - postmaster@xxx.yyy  addresss so you can be contacted regarding domain issues. Over the past year or two, They've been using it to verify domain ownership and if you don't respond, you can loose your domain. You should also have an mailto:abuse@xxx.yy - abuse@xxx.yy account, and a webmaster account is very optional. I usually alias abuse and webmaster to postmaster, and forward all postmaster accounts to an address that has excessive spam control.



-------------

Lead me not into temptation... I know the short cut, follow me.



Print Page | Close Window

Forum Software by Web Wiz Forums® version 12.08 - https://www.webwizforums.com
Copyright ©2001-2026 Web Wiz Ltd. - https://www.webwiz.net