JavaScript

Hopefully the following code will work for many years before the spam-bots get re-written to harvest even these email addresses.

I hope the recent increased number of hits to this page is a result of more users being pro-active and looking for solutions to reduce their spam. In case it is due to SPAMBOTS harvesting email using the javascript:sendMail as their search keywords I am removing my realtime email address from the examples and changing the function name to ss for Stop Spam. You should change the function name to something personal otherwise the spammers could simply add javascript:ss to their search keywords.
Updated: May 12, 2006
   <script language="JavaScript">
   <!--
   function sendMail(name, company, domain) {
      locationstring = 'mai' + 'lto:' + name + '@' + company + '.' + domain;
      window.location.replace(locationstring);
   }
   //-->
   </script>
   Changed to:
	 
	 <script language="JavaScript">
   <!--
   function ss(name, company, domain) {
      locationstring = 'mai' + 'lto:' + name + '@' + company + '.' + domain;
      window.location.replace(locationstring);
   }
   //-->
   </script>

Set up your mail link to call the function like this:

   <a href="javascript:sendMail('me','myserver','ca')">me@myserver.ca</a>
or 
   <a href="javascript:ss('me','myserver','ca')">me@myserver.ca</a>
Of course, all your effort could be defeated by the presence of the @ sign in the text portion of your link as the bots may detect this and add your email address to their list of victims.

It would be better to do this instead:
   <a href="javascript:sendMail('me','myserver','ca')">Send mail to J & J Systems</a>

or
   <a href="javascript:ss('me','myserver','ca')">Send mail to J & J Systems</a>
If you need to include more information in your email link, adjust your javascript to either of the following, remembering to change the function name to 'ss' or your personal function name for sendMail both in the javascript and in the javascript: call :

function ss(name, company, domain, subject, body)
{ locationstring = 'mai' + 'lto:' + name + '@' + company + '.' + domain + "?subject=" + escape(subject) + "&body=" + escape(body);
window.location.replace(locationstring); }

or

function ss(name, company, domain, subject, cc, bcc, body)
{ locationstring = 'mai' + 'lto:' + name + '@' + company + '.' + domain + "?cc=" + cc + "&bcc=" + bcc + "&subject=" + escape(subject) + "&body=" + escape(body);
window.location.replace(locationstring); }

Character Encoding

Besides plain english or ascii, every character can be represented in HTML in two more ways - an "HTML-encoded" format, and a"URL-encoded" format. Let's look at the HTML-encoded format first.

HTML Encoding

The character @ would be HTML-encoded as &#64;. Your mail link should look similar to:

   <a href="javascript:sendMail('me','myserver','ca')">me&#64;myserver&#46;ca</a>

You could forget about using JavaScript altogether and do this instead:

This is how it would appear on the page:

   Send mail to J & J Systems

..and this is how you would accomplish it:

  <a href="mailto:&#109;&#101;&#64;&#109;&#121;&#115;&#101;&#114;&#118;&#101;&#114;&#46;&#99;
&#97;">Send mail to J & J Systems</a>

URL Encoding

You could alternatively use URL encoding. It is your choice...one is as good as the other.

<a href="mailto:%6D%65%40%6D%79%73%65%72%76%65%72%2E%63%61">Send mail to J & J Systems

Enter your email address (or other text) here
Click to convert the above text: ->
Copy the HTML-encoded text into your HTML page
or copy the URL-encoded text into your HTML page
Through the understanding of the Spirit of God, whom is ALL in ALL, the promise of eternal life is made manifest - All are saved!
Programs, Certification - Association of Certified General Ethicists, Ethics Institute, Theanthropic Ethics, Dr. Brian Keen, Dr. John H. Roller, Dr. Edison Wiltshire Ethics Institute, Theanthropic Ethics, Power Living Club, Dr. Brian Keen Guildwood Village,dog groomers,accountants,banks, barbers,dentists,chiropracters,cleaners,day cares,hairstylists Dog Grooming Scarborough, Dog Grooming Guildwood Total Renovation Services, Interior Painting, Exterior Painting Real Estate Represeantative - Buy your dream home with no money down Affordable Hosting, Web Design and Domain Registration - Toronto Web Page Design Toronto - Affordable Hosting, Domain Registration and Website Design affordable web design toronto  Web Page Design Toronto Affordable Web Design Toronto Web Design Toronto - Affordable - Web Design Toronto Affordable Web Page Design Toronto ajax, toronto mentor, life coach, counselor, motivational speaker toronto printer repair, xerox parts, Used Laser printers, printer parts environment friendly landscape design, native plant species custom goal pads,custom goalie equipment, custom goalie pads, pad covers, hockey, accessories, Canada, Toronto, Ontario personalized Christmas ornaments, gingerbread christmas ornaments, Angel Christmas decorations, Snowman Christmas ornaments, Rebecca's Valentine, Rebecca Valentine, anniversary keepsakes, graduation, wedding mementos Scarborough Bluffs, wind turbines, wind farms, Toronto Hydro, Ontario, Canada, Guildwood Village, Toronto Beaches, anemometer catering,caterers,corporate, party,parties,family,families,patios,weddings,banquet halls, buffets,brunch,Sister's Restaurant & Banquets,Scarborough,Toronto Online Ministry, Bible Verses, Jesus Christ, Love, God, Pastor, Preacher Niagara-on-the-Lake B&B, luxurious weekend stay in Canada's 'prettiest town'
Copyright all rights reserved
J & J Systems Toronto - Affordable Web Design and Hosting
Last updated: June 22, 2010