Forum Moderators: open

Message Too Old, No Replies

What's the best way to embed an email address?

whilst remaining invisible to spambots

         

kaled

9:38 am on Oct 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



I need to display several email addresses. Naturally, I don't want them to be picked up by spammers' robots so I've started wondering about the use of divs, tables, javascript, etc.

It is not essential that they operate as links, but I guess it is desirable.

I don't want to use form-mail since attachments may be required.

Any thoughts?

Kaled.

Frank_Rizzo

12:07 pm on Oct 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



<P>Please email

<SCRIPT>
m1 = "support";
m2 = "pizza_widgets";
m3 = ".com";
document.write('<A HREF=\"mailto:' + m1 + '@' + m2 + m3 + '\">');
document.write('support</a>');
</SCRIPT>

for more assistance</P>

Saltminer

12:09 pm on Oct 10, 2004 (gmt 0)

10+ Year Member



You can use this encoder to convert the address to character codes:
[ohlone.cc.ca.us...]

Or you can use some javascript:
<script type="text/javascript">
<!--
emailAddr='domain.com'
emailAddr=('johndoe' + '@' + emailAddr)
document.write('<A href="mailto:' + emailAddr + '">' + emailAddr + '</a>')
//-->
</script>

Change the user and domain names to your own of course.
But if the visitor has javascript turned off they won't be able to email you.

Jimmy

edit: looks like Frank beat me to the reply. And as you can see there are many variations on ways to do it with javascript.

kaled

12:28 pm on Oct 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Yes, javascript does provide a solution. However, whilst I do use javascript on my site, I am currently redesigning things so that it will work ok without it.

I was thinking of something like
<table><tr><td>user</td><td>@</td><td>domain.com</td></tr></table>

However, I figure bots probably strip out basic tags so this wouldn't work. Nevertheless, something like this should be possible.

Perhaps, using <div style="display:none"> in the middle would work. Of course, then I have to remember to exclude robots from the page in case it attracts a site-wide hidden text penalty in the future.

Kaled.

Saltminer

12:53 pm on Oct 10, 2004 (gmt 0)

10+ Year Member



Then use the link to the encoder I posted above. I haven't had any spam from emails using that technique, and it will work with all browsers.

Jimmy

firstreflex

4:13 pm on Oct 10, 2004 (gmt 0)

10+ Year Member



Automatic Enkoder [automaticlabs.com]

tedster

7:13 pm on Oct 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



There are two address components that need to be masked most of all - "mailto:" and "@"

If you only mask the specific person's name and the domain name, but still leave these two clues visible, you've left a flashing red light.

I like address masking for another reason - it acts like an include that allows me to manage email addresses from one central file and update the addresses for all pages on a website with just one edit.

kaled

8:01 pm on Oct 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



How about this?

Create a 4 color gray-scale GIF image of the email address. Set the link target as simply "mailto:" but use obfuscated javascript to complete the link target. With a transparent part, hover-highlighting should be possible.

Does this seem reasonable?

Kaled.

bedlam

8:20 pm on Oct 10, 2004 (gmt 0)

WebmasterWorld Senior Member 10+ Year Member



Perhaps, using <div style="display:none"> in the middle would work. Of course, then I have to remember to exclude robots from the page in case it attracts a site-wide hidden text penalty in the future.

Two points about this:

  1. It wouldn't work in the first place; robots are not browsers ;) If something like this would work, you wouldn't have to worry about the robots finding the 'mailto' part of the link either...remember, they're reading the code, not the page.
  2. No sane search engine could implement a ban only because a site's CSS includes 'display:none;' There would have to be other factors involved, otherwise the SE would wind up banning sites for
    • Using print stylesheets
    • Using stylesheet switchers
    • Using css-based dropdown menus
    • Using FIR image replacement techniques

In answer to the original question, I would say that, if you're going to use mailto links (instead of forms - though by the way, attached files can also be sent via a form), then a compromise works best.

You could add your email links to the page in a form something like this:

[email-at-example.com]

...and use javascript to write and obfuscate the <a ... > tag so that it's un-obfuscated when it is clicked.

This has the disadvantage (of course it was one that you specifically wanted to avoid...) of not being clickable when javascript is disabled, but has the advantage of still being readable.

I mainly like to use forms for contact purposes, but I include mailto links with them using a method something like this, just in case someone doesn't like my forms :)

-B