Skip to Main Content



1Links Pages - General Content

Boxes on these pages contain links and widgets in groupings or links and widgets with training instructions.

  Protect your email from spammers

Box Type: RICH TEXT using HTML Source Editor

If you wish to place an email address within one of your LibGuides that is NOT in the right sidebar profile boxes, this is a safe way to do so without spammers harvesting your email.

Copy, paste and edit this text using HTML SOURCE EDITOR any place you want your email address to be so it is protected from spam email (from ISU's IT dept):

<script type="text/javascript">// <![CDATA[ document.write('<a href="mailto:' + (['[NetID]', 'iastate.edu?subject=[add subject]'].join('@')) + '">' + '[REPLACE TEXT]' + '</a>'); // ]]></script> <ins><noscript>[NetID]@iastate.edu(<div><code>[NetID] (at) iastate (dot) edu</code></div>)</noscript></ins>
  • Wherever you see the [RED BRACKETED TEXT], replace everything red with your NET-ID and VIEWABLE TEXT as indicated
  • Replace only [add subject] with text that will go in the subject line of the email.
  • If you do not want a subject line, remove "?subject=[add subject]" from the script.
  • Click the UPDATE button in the HTML Source Editor
  • Click the "Save and Close" button from the Rich Text Editor

When someone mouses over the text, it will show them the "mailto:" address, but spammers will not be able to harvest the email.

If you want to embed this in a sentence, copy and paste all but the <p> and </p> tags

The finished product would look like this to the browser (using my email as an example):

The Code (inserted parts in red for clarity):

<p>If you want to try variations on this script involving more complex email addresses and don't know how, <script type="text/javascript">// <![CDATA[
  
document.write('<a href="mailto:' + (['njdowell', 'iastate.edu?subject=Scripting Question'].join('@')) + '">' + 'Contact Me!' + '</a>');
// ]]></script>
<ins><noscript>njdowell@iastate.edu(<div><code>njdowell (at) iastate (dot) edu</code></div>)</noscript></ins>

The Result:

If you want to try variations on this script involving more complex email addresses and don't know how,

njdowell (at) iastate (dot) edu
)