Preventing Spam: How Can I Stop the E-mail Addresses on My Web Page from Receiving Spam?
Mask Your E-mail Address on Web Pages
Unfortunately, e-mail links on web pages are prime targets for spammers. Web based e-mail addresses are harvested by spambots or bots, which are robot software programs that scour the web to collect all of the unprotected e-mail addresses.
The HTML code for an unprotected e-mail address looks like this:
<A href="mailto:dmo9@georgetown.edu">dmo9@georgetown.edu</A>
If you use standard HTML code in your web page, your e-mail address will be vulnerable to collection by spambots. There are several methods to change the HTML code to mask the address so that your audience can use your e-mail links, but spambots can't.
Methods
- Spell AT and DOT
- Use Numeric Code Character Entity Refrences
- Encrypt your E-mail Address with JavaScript
Updating your Web page
You can copy and paste any of the examples below into your own web pages. Just highlight the code and press the CTRL-C to copy. Then open the web page that you are creating, and press CTRL-V to paste the text. After you paste the text, make sure that your change the e-mail address from the example to match your own.
Spell AT and DOT
Standard HTML uses a "mailto:" string of text to allow dynamic linking of text to an e-mail address. Bots will search your web pages for this string and capture the e-mail address that follows this text.
This method masks your e-mail address by replacing the @ sign with the word AT and the . with the word DOT. Web site visitors must recognize the extra text when they compose a message from the link, and replace the AT and DOT with the appropriate characters before sending the message.
Your e-mail address will appear on on the Web page like this:
click here to e-mail me
While the HTML code for the e-mail link will look like this:
<A href="mailto:usernameATgeorgetownDOTedu">click here to e-mail me</A>
When visitors click on the e-mail link, they will see the extra text in the TO: composition window.


The visitor can delete the extra text and send the e-mail.
Numeric Code Character Entity Refrences
You can also create an unharvestable e-mail address by spelling out the address in numeric code character entity references. These are substitution codes for letters, numbers, and special characters. A complete list of character translations is available at http://www.bbsinc.com/symbol.html
Your e-mail address will appear on on the Web page like this:
dmo9@georgetown.edu
While the HTML code for the e-mail link will look like this:
<A href="mailto:dmo9@geo
rgetown.ed
u">dmo9@geor
getown.edu</A>
Encrypt Using JavaScript
Another way to hide your e-mail address is to mask by it using JavaScript code.
In place of the standard HTML code,
<A href="mailto:dmo9@georgetown.edu">dmo9@georgetown.edu</A>
Use the following JavaScript:
<script language="Javascript" type="text/javascript">
<!-- Hide script from non-javascript-enabled browsers
// munger
var username="dmo9";
var at="@";
var domain="georgetown.edu";
// Do NOT edit below this line!
document.write("<a href='mailto:"+username+""+at+""+domain+"'>"+username+""+at+""+domain+"</a>");
// stop hiding -->
</script>
And the e-mail address will appear on on the Web page like this:
dmo9@georgetown.edu
back to the top of this page
back to the Index to Spam Resources