Protect email address from spam

How to protect email email addresses in web pages from spam?

If you use HTML clickable email display on a webpage like , you will end up a lot of spamming.

1. Hiding email address with CSS:

Using CSS display:none

<style type=”text/css”>
p span.displaynone { display:none; }

<p>silvanfoobar8@<span class=”displaynone”>null</span></p>

p span.displaynone { display:none; }</style><p>silvanfoobar8@<span class=”displaynone”>null</span></p>

2. Scrambling email addresses.

If you want to improve your chances even more you can embed the ASCII code in JavaScript. This code will create a mailto: link where it’s placed in the body section of the page.<script type="text/javascript">
document.write("<a href='mailto:put your scrambled address here'> Contact me!</a>")
// -->

Read here detail:

3. Inserting Text with JavaScript

<SCRIPT TYPE=”text/javascript”>
emailE=(‘yourname@’ + ’’)
‘<A href=”mailto:’ + emailE + ‘”>’
+ emailE + ‘</a>’

Read here detail:

4. Embedding javascript code

<script type=”text/javascript”>// <![CDATA[

document.write(‘<a href=”mailto:info’ + ‘@’ + ‘”>’ + ‘info’ + ‘@’ + ‘</a>’);

// ]]></script>

Or you may use these options:

  • Use graphics in displaying addresses
  • Use flash in displaying addresses
  • Use javascript or php contact forms