...

View Full Version : FormMail question



Jeepers
07-12-2002, 01:02 AM
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. :thumbsup: 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.:D

Calilo
07-12-2002, 05:54 AM
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

Jeepers
07-12-2002, 09:34 AM
Thanks. I'll give that a go

Philip M
07-12-2002, 07:59 PM
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.

redhead
07-13-2002, 04:50 PM
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 :eek:

Jeepers
07-16-2002, 12:07 AM
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 :thumbsup:



EZ Archive Ads Plugin for vBulletin Copyright 2006 Computer Help Forum