Office of Information Technology
WMU Home About WMU Academics Admissions Student Life Alumni and Friends
   

WMU > OIT > Help Desk > Web

Protecting Web Page E-mail Addresses From Spambots

Spammers have developed robot programs (called spambots) that harvest e-mail addresses from Web pages by looking for strings of text that follow a typical e-mail address pattern, e.g. joe.bronco@wmich.edu. If you do not use those strings in your Web pages, you may be able to help prevent some of the spam mail hitting your addressees. WMU students, faculty, and staff may use the safemail javascript to rewrite e-mail addresses on their Web pages.

  1. Insert the below line of code between the <head> and </head> of your page.

    www.wmich.edu pages

    <script src="/javascript/os/safemail.js" type="text/javascript"></script>

    or, if on homepages.wmich.edu

    <script src="http://www.wmich.edu/javascript/os/safemail.js" type="text/javascript"></script>
  2. Then, replace your <a href="mailto:first.last@wmich.edu">first.last@wmich.edu</a> text with: (replace items shown in blue with your specific information)

    <script>safemail("firstname.lastname","wmich.edu"," ")</script>

Safemail Options

  1. <script>safemail("firstname.lastname","wmich.edu"," subject")</script>

    When someone clicks on the e-mail link, the subject will display as the subject of their message. If no subject is desired, use " " as shown in step 2 above.
  2. <script>safemail("firstname.lastname","wmich.edu"," ","First Last")</script>

    Instead of displaying a linked firstname.lastname@wmich.edu address on the page, a linked First Last will display. You may substitute anything you want to display as the e-mail link.

The javascript will use the information you provided to write the e-mail links to your viewed page, but the e-mail address will not be found within your page's source code, thus preventing spambots from finding it. If you have any questions about this procedure, you may .

 

 
Office of Information Technology, Western Michigan University, Kalamazoo, Michigan, 49008-5206
Phone (269) 387-5430 |
Contact OIT | Last Updated: February 29, 2008
Report Copyright Infringements
Western Michigan University Student Information System Western Michigan University