How to hide email addresses used with FormMail Pearl script and HTML form OPTION values

Posted on 2005-02-24
Medium Priority
Last Modified: 2010-04-06
I have created an HTML form to work with the free FormMail 1.92 Pearl script (see http://www.scriptarchive.com/formmail.html). I want to send an email to the appropriate contact depending on the visitor's choice from a combo box, but I want to do this without allowing spam search engines any way to see the email addresses. I'm guessing there is a way to do this with Javascript and there may be other better ways such as customizing the Pearl script FormMail. I'm looking for code to do this easily and effectively! Thanks.
Question by:Dan_JB
  • 2
  • 2

Expert Comment

ID: 13395933
If the email address is contained in code that is processed on the server side, I'm not sure that it would be viewable by bots unless you have it displayed on the page somewhere.

Author Comment

ID: 13396013
To do that I would need to customize formmail.pl which is certainly a possiblity if I know what to change.

Currently I'm just using a simple HTML form with code like this (which I presume would be viewable by bots as it is just in the HTML code):

<SELECT NAME="recipient">
      <OPTION VALUE="0" selected>-Select-</OPTION>
      <OPTION VALUE="employee1@domain.com">Customer Service</OPTION>
      <OPTION VALUE="employee2@domain.com">Sales</OPTION>
      <OPTION VALUE="employee3@domain.com">Careers</OPTION>

The value of recipient determines who the form is sent to. This is actually an array passed to formmail.pl.

LVL 53

Accepted Solution

COBOLdinosaur earned 1500 total points
ID: 13397169
Just change it to mess up the spambots

instead of


Then just modify the perl script to drop the first character and replace the _ with @.  

There are any number of simple character replacements yu can do and then just convert it on the server side.


Author Comment

ID: 13405143
I have modified the check_required subroutine to include the following lines at the beginning (I did not use '_' as this could theoretically be a valid character in an address):

$Config{'recipient'} =~ tr/+?/@./;   # converts all zemployee1+domain?com to zemployee1@domain.com
$Config{'recipient'} =~ s/^.//;        # removes first character resulting in employee1@domain.com
$Config{'recipient'} =~ s/,z/,/g;      # if more than one email was submitted remove other 'z' prefixes

There might be a cleaner way to do this, but this works! Any suggestions to clean-up COBOLdinosaur? recipient is a comma delimited text string (as submitted from the form field).

LVL 53

Expert Comment

ID: 13413049
That looks efficient, and as you said it works. :^)


Featured Post

The 14th Annual Expert Award Winners

The results are in! Meet the top members of our 2017 Expert Awards. Congratulations to all who qualified!

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Preface This is the third article about the EE Collaborative Login Project. A Better Website Login System (http://www.experts-exchange.com/A_2902.html) introduces the Login System and shows how to implement a login page. The EE Collaborative Logi…
Have you tried to learn about Unicode, UTF-8, and multibyte text encoding and all the articles are just too "academic" or too technical? This article aims to make the whole topic easy for just about anyone to understand.
HTML5 has deprecated a few of the older ways of showing media as well as offering up a new way to create games and animations. Audio, video, and canvas are just a few of the adjustments made between XHTML and HTML5. As we learned in our last micr…
The viewer will learn the basics of jQuery, including how to invoke it on a web page. Reference your jQuery libraries: (CODE) Include your new external js/jQuery file: (CODE) Write your first lines of code to setup your site for jQuery.: (CODE)

607 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question