Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Good e-mail link protection methods

Can you guys post methods of e-mail link spam-protection (in php or javascript)?

Basically I want to put a "mailto" link on a web page, like

<a href="mailto:[email protected]">E-mail me</a>

but I don't want the spam bots to pick it up and then spam me with penis enlargement emails :)

So far, I found a javascript obfuscator here: http://www.jottings.com/obfuscator/ Not sure how effective it is though..

like image 833
Alex Avatar asked Apr 10 '11 03:04

Alex


People also ask

What is a good way to protect sensitive information sent via email?

Encryption is the most effective way to protect your data from unauthorized access. Encryption can be defined as transforming the data into an alternative format that can only be read by a person with access to a decryption key.


1 Answers

JavaScript Solution

With JavaScript you can do the following.

emailE = ('yourname@' + 'emailserver.com')
document.write('<A href="mailto:' + emailE + '">' + emailE + '</a>')

With this, Crawlers can no longer read your email from source code.

PHP solution

With php you can convert your email to unicode values

function converte($email) {
    $p = str_split(trim($email));
    $new_mail = '';
    foreach ($p as $val) {
        $new_mail .= '&#'.ord($val).';';
    }
    return $new_mail;
}

and on your page use the function like

<?php echo converte('[email protected]'); ?>

Source code output will be something like

&#109;&#97;&#105;&#108;&#46;&#99;&#111;&#109;
like image 128
Hussein Avatar answered Oct 13 '22 19:10

Hussein