Home Downloads Portfolio About Links

Blue Rose Systems EmailLink 1.0

Download EmailLink 1.0

EmailLink is a FREE custom web control written in C# for ASP.NET. It uses injected client-side Javascript to protect the mailto: link and text from SpamBots that are not Javascript aware. It uses a simple encoding technique for the address to make it unreadable. This is a step beyond simple HTML encoding which is not human readable but is easily read by SpamBots.

If you have any questions, comments, or criticisms please email me at  (this link actually uses the EmailLink control so if you do "View Source" you can see what the Javascript looks like. Since this is the initial version of the control, please let me know if you find any issues with it and I'll be happy to fix them. I am also interested to know if anyone actually finds this useful and ends up implementing it on their site. So if you do end up using it, please send me a note with a link.

I developed this control because I had a site that started getting crawled by bots and the address in my mailto link almost immediately started receiving spam. After some research it seemed like the choices were to not use mailto: at all, or to encode the address and text somehow.

The encoding technique used is a cryptogram technique, where each letter maps to some other letter. This is simple to implement in Javascript, and would be very hard for something to decode. Of course if a SpamBot was Javascript aware, then all bets are off, but based on my research, Javascript encoding is very effective against SpamBots. I suppose there are so many unencoded mailto addresses out there that spammers don't need to go through the trouble of trying to decode your Javascript, they will just move on to the next unprotected site.

This control is simple to use, just add the assembly to the toolbox, drag it to your web form, and set the Text and EmailAddress properties. You can have multiple controls on the same form.

The source code is provided as part of the download and this control is free to use for any purpose you see fit. If you find this control and have a links page, I would really appreciate a link to my site, but that is entirely up to you.

Properties
  • EmailAddress (string) - The address to put in the mailto: link.
  • Text (string) - The content to display on the screen.
  • EncodeText (boolean) - If True, the content displayed on the screen is encoded and protected with Javascript. This is because SpamBots can harvest email addresses from content. If the email address is not in plain text in the content of the link, you can set this to False.
  • CssClass (string) - If specified, the CSS class name to associate with the link (in order to do hover effects, etc).
  • NoScriptText (string) - The content to display if EncodeText is True and the browser does not support Javascript or Javascript is disabled in the browser.

Sample Code

<brs:EmailLink id="Emaillink1" EmailAddress="user@somedomain.com" EncodeText="True" runat="server">user@somedomain.com</brs:EmailLink>