- Sue Nolff - http://www.suenolff.com -

Email linking on your site

The days of the mailto: email link should be long gone, but unfortunately there are still millions of those type of links out there. I don’t necessarily mean unfortunately for you or me; I mean unfortunately for the millions of people who are the poor recipients of email from such links out there.

There are thousands of nasty little spambots out there just searching the web hour after hour, zeroing in on that little snippet of code known as a mailto: email link. Bingo, when they find one, the email address that comes immediately after mailto: in the link will be massively bombarded over time with spam. Did you ever really wonder how that poor widow in Nigeria got your email address?

Every good web design company has an even better web programmer. That web programmer can spend up to 1/3 of his or her time just trying to stay one step ahead of the hackers and spammers. In larger companies, it can be a full time job.

The mailto: spam debacle is generally one of the easier problems to troubleshoot, and I’ve seen many different workarounds.

Some people just type out their email address but don’t make it a link. This is fine, but it forces the person who wants to email you to have to write it down, or copy it over to their email program in order to email you. That’s where human error enters the picture.

Some are even afraid to type out their full email address on a web page so they take that human error factor one step deeper and tell people to email them at myname at mysite.com.

Now, I’ve also seen some ingenious workarounds. I’ve seen code that turns typed email addresses into images of the letters because the spambots can’t read text in images. That one is pretty cool!!! But it’s also pretty complicated for the average site.

My favorite solution is a simple javascript, placed in an external javascript page. I’m so fond of it that I’m about to share it with you. Copy and paste the following into your external javascript page, or just in the head area of your page:

<script type=”text/JavaScript”>
<!- –
  function myEmail(prt1,prt2,id,subject){
    //redirect to mailto
    if (subject == undefined ){
      window.location = ‘mailto:’+ prt1 +’@’+ prt2;
    }else{
      window.location = ‘mailto:’+ prt1 +’@’+ prt2 + ‘?Subject=’ + subject;
    }
    return false;
  }
– ->
</script>

Now instead of the mailto: email link in the body of your document use this:

<a href=”javascript:void(0);” onClick=”myEmail(‘myname’,’mysite.com’,this,’Website Contact’);” title=”Click here to email us”>email us</a>

Now how cool is that?! And if you think about it, how much more simple could it be?

9 Comments (Open | Close)

9 Comments To "Email linking on your site"

#1 Comment By tv online live On May 23, 2011 @ 7:46 pm

Interesting, I wonder what the statistics are on your first point there…

#2 Comment By sohbet On May 25, 2011 @ 8:12 am

Hi, i think that i saw you visited my blog thus i came to “return the favor”.I’m trying to find things to improve my website!I suppose its ok to use a few of your ideas!!

#3 Comment By tv online On May 28, 2011 @ 10:04 am

I thought it was going to be some boring previous post, but it seriously compensated for my time. I will publish a website link to this page on my weblog. I am certain my website visitors will discover that pretty useful.

#4 Comment By host gator coupon On May 29, 2011 @ 5:54 pm

Every time I stumble upon a great blog post I usually do one of three thing:1.Forward it to all the close contacts.2.Bookmark it in all of the popular bookmarking websites.3.Make sure to return to the same website where I first read the article.After reading this article I’m really thinking of doing all of the above!

#5 Comment By Rashida Can On June 9, 2011 @ 10:18 am

Major thanks for the article post. Will read on…

#6 Comment By Galen Bohonik On June 23, 2011 @ 7:20 pm

Excellent article and easy to understand explanation. How do I go about getting permission to post part of the article in my upcoming news letter? Giving proper credit to you the author and link to the site would not be a problem.

#7 Comment By Cathy Pazan On July 22, 2011 @ 12:12 pm

The blog was absolutely fantastic! Lots of great information and inspiration, both of which we all need!

#8 Comment By Jean Ennels On July 25, 2011 @ 2:33 am

Wow! This can be one particular of the most helpful blogs We’ve ever arrive across on this subject. Actually Magnificent. I’m also an expert in this topic so I can understand your hard work.

#9 Comment By Sms On August 9, 2011 @ 12:34 am

I wish more people would write blogs like this that are really enjoyable to study. With all of the fluff floating about on the web, it’s rare to read a weblog like yours instead.