/    Sign up×
Community /Pin to ProfileBookmark

cool anti-spam code

We were drawing up a web site and this issue of do we put our email up and allow it to be harvested by spam bots. Anyway one of the developer boffins kiril karaatanasov came up with this cool bit of code that hides your address from the spam bots, who see junk rather than an address. I thought there might be some that are interested.
You just paste it in an HTML. You can change the name, domain, subject and body etc.
The e-mail link points to name@domain address and the message has subject equal to “subject” and body equal to “body”. This can make ones life easier if he is thinking how to start the e-mail and what subject to pick
…And you still have the advantage of hiding your address
He seemed to think that everyone knew about it… given the amount of Spam I get off my address being advertised I am not sure that is the case.

<SCRIPT LANGUAGE=”JavaScript”>

<!–

var name = “kiril.karaatanasov”;

var domain = “sciant.com”;

var subject = escape(“Hello Kiril”);

var body = escape(“Hello Kiril,”);

document.write(“<a href=’mailto:” + name + “@” + domain + “?subject=” + subject + “&Body=” + body + “‘ >” +name + “@” + domain+ “</a>”);

//–>

</SCRIPT>

to post a comment
JavaScript

10 Comments(s)

Copy linkTweet thisAlerts:
@JonaOct 15.2004 — [font=trebuchet ms]That's cool, however what if someone does not have JavaScript? They won't see your link! You should encode the @-symbol instead, because email harvesters won't know it's an email address if you do, yet the link will still work.[/font]

<i>
</i>&lt;a href="mailto:you&amp;amp;#64;yoursite.com" title="Email me"&gt;you&amp;amp;#64;yoursite.com&lt;/a&gt;


[font=trebuchet ms]The output will be the same as normal, but will work universally and keep those nasty butts off your web site. I mean, [i]bots.[/i] ? [/font]
Copy linkTweet thisAlerts:
@jbotOct 15.2004 — Jona, how will search engine bots cope tho? won't they be thrown off too. if so, shouldn't your code be qualified to detect googlebot, etc, perhaps using an SSI or other include type.
Copy linkTweet thisAlerts:
@JonaOct 15.2004 — [i]Originally posted by jbot [/i]

[B]Jona, how will search engine bots cope tho? won't they be thrown off too. if so, shouldn't your code be qualified to detect googlebot, etc, perhaps using an SSI or other include type. [/B][/QUOTE]


[font=trebuchet ms]Why would you want a search engine to index your email address? ? If anything, you should try to avoid that.[/font]
Copy linkTweet thisAlerts:
@jbotOct 15.2004 — [i]Originally posted by Jona [/i]

[B][font=trebuchet ms]Why would you want a search engine to index your email address? ? If anything, you should try to avoid that.[/font] [/B][/QUOTE]


apart from arguing about spammers data-mining google to get email addresses, i don't see the problem with it.
Copy linkTweet thisAlerts:
@JonaOct 15.2004 — [font=trebuchet ms]Chances are nothing will determine that it is an email address, and simply overlook it; this is a good thing, because it's almost the same as just not putting your email address on the Internet at all.[/font]
Copy linkTweet thisAlerts:
@neil9999Oct 15.2004 — Put this php script I just made on your page and it should flood the spammers computers by generating loads of fake email addresses!

[code=php]<html>
<head>
</head>
<body>
<?php
$lets=array(0=>"a","b","c","d","e","f","g","h","i","j","k","l","m","n","o","p","q","r","s","t","u","v","w","x","y","z");
//Change 1000 on next line to however many email addresses you want to create
for($j=1; $j<=1000; $j++){
$emailad="";
//Change 40 on next line to how many letters should be in each email address (excluding '.com' and '@')
for($i=1; $i<=40; $i++){
$rndno=rand(0,25);
$emailad=$emailad.$lets[$rndno];
//Change 20 on next line to how many of these letters should be BEFORE the '@' symbol in the email address
if($i==20){
$emailad=$emailad."@";
}
}
//Change .com on the next line to the extension you would like to use for your email addresses eg. ".co.uk",".org",".net" etc.
$emailad=$emailad.".com";
echo "<p><a href="mailto:".$emailad."">".$emailad."</a></p>";
}
?>
</body>
</html>[/code]


Neil
Copy linkTweet thisAlerts:
@JonaOct 15.2004 — [font=trebuchet ms]Neil, this post concerns reserving one's email address and keeping it out of the hands of spammers; we're not trying to be malicious to them, even though what they do is uncalled for, in my personal opinion.[/font]
Copy linkTweet thisAlerts:
@neil9999Oct 15.2004 — [i]Originally posted by Jona [/i]

[B][font=trebuchet ms]Neil, this post concerns reserving one's email address and keeping it out of the hands of spammers; we're not trying to be malicious to them, even though what they do is uncalled for, in my personal opinion.[/font] [/B][/QUOTE]


Maybe it would crash their computers, then they'd loose all their email addresses?
Copy linkTweet thisAlerts:
@JonaOct 15.2004 — [i]Originally posted by neil9999 [/i]

[B]Maybe it would crash their computers, then they'd loose all their email addresses? [/B][/QUOTE]


[font=trebuchet ms]If it doesn't crash the server it's running on, it probably won't crash anything else; but even so, I have had a sudden, revelatory change of intellect. Go for it, I hope it works! ? [/font]
Copy linkTweet thisAlerts:
@neil9999Oct 16.2004 — [i]Originally posted by Jona [/i]

[B][font=trebuchet ms]If it doesn't crash the server it's running on, it probably won't crash anything else;[/font] [/B][/QUOTE]


The server it's running on only has to generate the email addresses, which is short enough. The spammers computer has to send the emails out to all of them, and then cope with the thousands of 'mail delivery errors' coming back!

I've added comments to my original code to show which numbers to change.

Neil
×

Success!

Help @magus007 spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 4.30,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,

tipper: @Samric24,
tipped: article
amount: 1000 SATS,
)...