Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 6 of 6
  1. #1
    Regular Coder
    Join Date
    Jun 2002
    Location
    Conwy. UK
    Posts
    122
    Thanks
    0
    Thanked 0 Times in 0 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
    Regular Coder
    Join Date
    Jun 2002
    Location
    Mex
    Posts
    122
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #3
    Regular Coder
    Join Date
    Jun 2002
    Location
    Conwy. UK
    Posts
    122
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Thanks. I'll give that a go
    An answer needs a question just as much as a question needs an answer. Deep eh!

  • #4
    Supreme Master coder! Philip M's Avatar
    Join Date
    Jun 2002
    Location
    London, England
    Posts
    17,898
    Thanks
    203
    Thanked 2,531 Times in 2,509 Posts
    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 noperson@nowhere.com. Of course, the action of the form must submit to your cgi-bin as before.
    Last edited by Philip M; 07-12-2002 at 07:10 PM.

  • #5
    Regular Coder
    Join Date
    Jun 2002
    Location
    United Kingdom Confused: Often
    Posts
    859
    Thanks
    0
    Thanked 0 Times in 0 Posts
    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

  • #6
    Regular Coder
    Join Date
    Jun 2002
    Location
    Conwy. UK
    Posts
    122
    Thanks
    0
    Thanked 0 Times in 0 Posts

    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!


  •  

    Posting Permissions

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