Page 1 of 3 123 LastLast
Results 1 to 10 of 29

Thread: Hiding email addresses from spammers

  1. #1
    Join Date
    Feb 2006
    Posts
    20

    Default Hiding email addresses from spammers

    I share the concern of other users about the risk of exposing email addresses to spammers. In the past, I have had to abandon a domain because of spam, and I am desparately avoiding to have to do so again.

    One of the solutions I have adopted is to hide my email addresses with javascript. I use a standard bit of code to create a mailto tag (those who have javascript disabled will just have to phone me!). I will display it here for your convenience, but the point is that this script can be adapted and used in forms for formmail.

    The normal script is like this:
    <p>
    Please contact me on
    <SCRIPT type="text/javascript" language="javascript"><!--
    Textaddress='.'+ 'com';//tld as first part of the email address
    Textaddress=('tectite'+ Textaddress);//domain as second part of the email address
    Textaddress=('Robinson'+ '@' + Textaddress);//user surname as third part of the email address
    Textaddress=('Russell'+ '.' + Textaddress);//user (eg john) as third part of the email address
    Textalternative='my email address';//insert what the mailto link should look like on screen
    var Textonscreen;if(Textalternative!=''){ Textonscreen=Textalternative; } else { Textonscreen=Textaddress; }
    Textsubject=escape('Enquiry about Formmail');//insert the desired email subject line
    Texttitle='Send email';//insert the desired link tip text on mouse-over
    Textstatus='Click here to send me an email';//insert the desired statusbar text
    Textclass='MyStyle';//insert the name of the desired css class
    Texttagid='number';//insert the ID of the mailto tag
    document.write('<A href="mai'+ 'lto:' + Textaddress + '?subject=' + Textsubject + '" ' + 'title="' + Texttitle + '" ' + 'onMouseOver=' + '"status=\'' + Textstatus + '\';return true' + '" ' + 'onMouseOut=' + '"status=\'\';return true' + '" class="' + Textclass + '" ID="' + Texttagid + '">' + Textonscreen + '</' + 'A>')//shows the constructed tag on screen
    //--></SCRIPT>
    <NOSCRIPT>
    [This email address is hidden by JavaScript; enable scripts in your browser to see and use it.]
    </NOSCRIPT>
    to make send enquiries.
    </p>


    In forms for formmail, a hidden field must be created to specify the recipient email address. The following code should produce the hidden field in such a way that spam robots will have great difficulty finding and constructing it:
    <SCRIPT type="text/javascript" language="javascript"><!--
    Textaddress ='.'+ 'com';//tld as first part of the email address
    Textaddress =('tectite' + Textaddress);//domain as second part of the email address
    Textaddress=('Robinson'+ '@' + Textaddress);//user surname as third part of the email address
    Textaddress=('Russell'+ '.' + Textaddress);//user (eg john) as third part of the email address
    document.write('<input type="hidden" name="recipients" value="' + Textaddress + '" />')
    //--></SCRIPT>

    This script can be inserted in the body of the form document, exactly where you would otherwise put the hidden field tag.

    I hope this will be of help.

    Perhaps this could also be a pointer for a future release.

  2. #2
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Hiding email addresses from spammers

    Hi,

    Thanks for the suggestion. We use something similar on our website.

    We're currently looking at a option to put email addresses inside the config section of FormMail, thereby avoiding them being in the HTML form at all.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  3. #3
    Join Date
    Feb 2006
    Posts
    28

    Default Re: Hiding email addresses from spammers

    Quote Originally Posted by russellr
    Hi,

    Thanks for the suggestion. We use something similar on our website.

    We're currently looking at a option to put email addresses inside the config section of FormMail, thereby avoiding them being in the HTML form at all.
    Hi,

    Any idea, when this option will be available? Since I can't make the js from the prev post work. The hidden value is not passed to the form, and therefore getting no recipient error.

  4. #4
    Join Date
    Dec 2003
    Posts
    3,980

    Default Re: Hiding email addresses from spammers

    Hi,

    A matter of days. Probably early next week.
    Russell Robinson - Author of Tectite FormMail and FormMailDecoder
    http://www.tectite.com/

  5. #5
    Join Date
    Feb 2006
    Posts
    28

    Default Re: Hiding email addresses from spammers

    Quote Originally Posted by russellr
    Hi,

    A matter of days. Probably early next week.

    Great. Can't wait... very well done script. thanks a lot.

  6. #6
    Join Date
    Feb 2006
    Posts
    20

    Default Re: Hiding email addresses from spammers

    If you hard-code the tag, and then replace document.write in the example with alert, then you can compare if the result of the script is actualy exactly what you want it to be. The script works, but you might have made a mistake filling it in. Or, perhaps, you put it in the wrong location; it should not be between the header tags or in a js sourcefile, but in the html where you would normally put the hard-coded tag.

  7. #7
    Join Date
    Feb 2006
    Posts
    28

    Default Re: Hiding email addresses from spammers

    Quote Originally Posted by ewel
    If you hard-code the tag, and then replace document.write in the example with alert, then you can compare if the result of the script is actualy exactly what you want it to be. The script works, but you might have made a mistake filling it in. Or, perhaps, you put it in the wrong location; it should not be between the header tags or in a js sourcefile, but in the html where you would normally put the hard-coded tag.

    yeah, but can't seem to make it work :-)
    Textaddress ='.'+ 'com';//tld as first part of the email address
    Textaddress =('arrowlimos' + Textaddress);//domain as second part of the email address
    Textaddress=('test'+ '@' + Textaddress);//user surname as third part of the email address
    Textaddress=(''+ '.' + Textaddress);//user (eg john) as third part of the email address
    document.write('<input type="hidden" name="recipients" value="' + Textaddress + '" />')

    is not working. where is my mistake?

  8. #8
    Join Date
    Feb 2006
    Posts
    20

    Default Re: Hiding email addresses from spammers

    The script caters for double user names, eg. 'john.doe'. If the user name is single, eg. 'john' or 'johndoe', then the fourth line of the script is not only superfluous but causes an error because it adds a dot before, eg. '.john' or '.johndoe'. Sorry for not commenting this into the script.

    Your username is test, so you were using only three of the four lines that build the address, clearly because you have no need for the first name part. Just delete the fourth line, that is the line before document.write:
    Code:
    Textaddress=(''+ '.' + Textaddress);//user (eg john) as third part of the email address
    Once I am at it, I should perhaps also note that if your user name were to be 'john_doe', you would use all four lines, but you would have to replace the dot in the fourth line by an underscore, like this:
    Code:
    Textaddress=('john'+ '_' + Textaddress);//user (eg john) as third part of the email address

  9. #9
    Join Date
    Feb 2006
    Posts
    28

    Default Re: Hiding email addresses from spammers

    Quote Originally Posted by ewel
    The script caters for double user names, eg. 'john.doe'. If the user name is single, eg. 'john' or 'johndoe', then the fourth line of the script is not only superfluous but causes an error because it adds a dot before, eg. '.john' or '.johndoe'. Sorry for not commenting this into the script.

    Your username is test, so you were using only three of the four lines that build the address, clearly because you have no need for the first name part. Just delete the fourth line, that is the line before document.write:
    Code:
    Textaddress=(''+ '.' + Textaddress);//user (eg john) as third part of the email address
    Once I am at it, I should perhaps also note that if your user name were to be 'john_doe', you would use all four lines, but you would have to replace the dot in the fourth line by an underscore, like this:
    Code:
    Textaddress=('john'+ '_' + Textaddress);//user (eg john) as third part of the email address
    You were correct, it was so obvious, tired over here. Thank you so very much!

  10. #10
    Join Date
    Dec 2006
    Posts
    2

    Default Re: Hiding email addresses from spammers

    Quote Originally Posted by russellr
    Hi,

    Thanks for the suggestion. We use something similar on our website.

    We're currently looking at a option to put email addresses inside the config section of FormMail, thereby avoiding them being in the HTML form at all.

    Did anything ever come of this?

    I'm using version 7.12 on my information site, scienceandyou.org in a slightly unusual role. It allows visitors to rate the essays, the result of which is then emailed to me.

    (It works well by the way and thank you for making it available. I replaced the pl script from matt wright.)

    Lately I was getting spam in the comment box, so I've just incorporated the js solution which works well. Now I'm wating to see if I've foiled the spammers.

    Anyhow, the solution you propose does have a certain appeal.

    Best,

    -Hank Mulder

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Similar Threads

  1. Can send to outside e-mail addresses, but not internal
    By Jeremy Aldrich in forum Community Support
    Replies: 6
    Last Post: 09-Jul-2007, 04:26 AM
  2. mail sent to certain addresses only
    By kc3 in forum FormMail Subscription Support
    Replies: 1
    Last Post: 26-Oct-2005, 12:50 AM
  3. stop the spammers!
    By piemanek in forum FormMail Subscription Support
    Replies: 0
    Last Post: 13-Sep-2005, 01:57 PM
  4. Email goes to several addresses but not others, please help
    By WideGlide in forum FormMail Subscription Support
    Replies: 3
    Last Post: 12-Apr-2005, 06:14 PM
  5. Spammers and E-mail
    By JohnB in forum FormMail Subscription Support
    Replies: 1
    Last Post: 30-Dec-2004, 07:59 PM

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •