title: How to stop spammers from getting the email address from a mailto link?
body: <h3>Duplicate:</h3>
  <blockquote>
  <ul>
  <li><a href="https://stackoverflow.com/questions/748780/best-way-to-obfuscate-an-e-mail-address-on-a-website/">Best way to obfuscate an e-mail address on a website?</a></li>
  <li><a href="https://stackoverflow.com/questions/483212/effective-method-to-hide-email-from-spam-bots">Effective method to hide email from spam bots</a></li>
  <li><a href="https://stackoverflow.com/questions/308772/what-are-some-ways-to-protect-emails-on-websites-from-spambots">What are some ways to protect emails on websites from spambots?</a></li>
  </ul>
  </blockquote>
  <hr />
  <p>What is the best way to prevent spammers from getting the email address from your mailto links? I'm under the impression that javascript could be a solution. I don't know if my current solution is fool proof, so that's why I'm asking.</p>
  <p>Here's what I'm currently doing:</p>
  <pre><code>&lt;script language=&quot;JavaScript&quot;&gt;&lt;!--
  var name = &quot;emailusername&quot;;
  var domain = &quot;yahoo.com&quot;;
  var text = &quot;emailusername@yahoo.com&quot;;
  document.write('&lt;a href=\&quot;mailto:' + name + '@' + domain + '\&quot;&gt;');
  document.write(text + '&lt;/a&gt;');
  // --&gt;&lt;/script&gt;
  </code></pre>
  <p>Is there is a better way? I don't like having to have this chunk of code everywhere I want to put a mailto link.</p>