Web Analytics Made Easy -
StatCounter FormMail question - CodingForum

Announcement

Collapse
No announcement yet.

FormMail question

Collapse
X
 
  • Filter
  • Time
  • Show
Clear All
new posts

  • FormMail question

    My server uses formmail to mail me my form enquiries. I would like to put the recipient email address within the perl file instead of as a hidden field in the html file (to try and avoid harvesting etc).

    Not only do I have no idea how to do this I also have no clue regarding perl either.

    Providing that it is possible to do this, it would be great if somebody could give me the idiots guide to solving it or just post the code so that I could paste it into the .pl file. There will only ever be one address to mail to. I am using ver 1.9 dated 8/3/01 on an NT server (if that makes any difference)

    Any help on this would be fantastic.
    An answer needs a question just as much as a question needs an answer. Deep eh!

  • #2
    well if you want to mess a bit with the script you can just look for a line which says,

    print MAIL "to: somehitng";

    or somehting similar, probly the something will be $FORM{to} not sure how the script was done, then just change the something to your e-mail address, and youll be done, just reupload the file in ascii mode and chmod it 755,

    or else if you want i can post an already done scirpt that send all the info to your mail

    Calilo

    Comment


    • #3
      Thanks. I'll give that a go
      An answer needs a question just as much as a question needs an answer. Deep eh!

      Comment


      • #4
        To be more specific, find this section in the formmail script and adjust it as follows:-

        sub send_mail {
        # Localize variables used in this subroutine. #
        local($print_config,$key,$sort_order,$sorted_field,$env_report);

        # Open The Mail Program
        open(MAIL,"|$mailprog -t");

        ##########################################
        # print MAIL "To: $Config{'recipient'}\n"; # Disabled - recipient is hard coded #
        ##########################################

        print MAIL "To: yourname\@yourdomain.com\n"; # Only this one valid recipient #


        Don't forget to escape the @ sign with a \ backslash.


        You can then alter the hidden field 'recipient' in your html form to a ficticious email address such as [email protected]. Of course, the action of the form must submit to your cgi-bin as before.
        Last edited by Philip M; Jul 12, 2002, 02:10 PM.

        All the code given in this post has been tested and is intended to address the question asked.
        Unless stated otherwise it is not just a demonstration.

        Comment


        • #5
          or you could write it in with JavaScript, as harvesters cant read it...

          <script>
          name="bob";
          domain="hotmail.com";
          code='<input type="hidden" name="mailto" value="'+name+'@'+domain+'" \/>';
          document.writeln(code)
          </script>

          sorry to talk about such things in a server side forum
          redhead

          Comment


          • #6
            Stunning

            Thats great, thanks a lot, don't quite know what I'm doing but I've done what you siad and it works a treat. Thanks guys
            An answer needs a question just as much as a question needs an answer. Deep eh!

            Comment

            Working...
            X