Go Back   CodingForums.com > :: Server side development > Perl/ CGI

Before you post, read our: Rules & Posting Guidelines

Reply
 
Thread Tools Rate Thread
Enjoy an ad free experience by logging in. Not a member yet? Register.
Old 07-12-2002, 12:02 AM   PM User | #1
Jeepers
Regular Coder

 
Join Date: Jun 2002
Location: Conwy. UK
Posts: 122
Thanks: 0
Thanked 0 Times in 0 Posts
Jeepers is an unknown quantity at this point
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!
Jeepers is offline   Reply With Quote
Old 07-12-2002, 04:54 AM   PM User | #2
Calilo
Regular Coder

 
Join Date: Jun 2002
Location: Mex
Posts: 122
Thanks: 0
Thanked 0 Times in 0 Posts
Calilo is an unknown quantity at this point
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
Calilo is offline   Reply With Quote
Old 07-12-2002, 08:34 AM   PM User | #3
Jeepers
Regular Coder

 
Join Date: Jun 2002
Location: Conwy. UK
Posts: 122
Thanks: 0
Thanked 0 Times in 0 Posts
Jeepers is an unknown quantity at this point
Thanks. I'll give that a go
__________________
An answer needs a question just as much as a question needs an answer. Deep eh!
Jeepers is offline   Reply With Quote
Old 07-12-2002, 06:59 PM   PM User | #4
Philip M
Supreme Master coder!

 
Philip M's Avatar
 
Join Date: Jun 2002
Location: London, England
Posts: 17,033
Thanks: 197
Thanked 2,410 Times in 2,388 Posts
Philip M has a spectacular aura aboutPhilip M has a spectacular aura aboutPhilip M has a spectacular aura about
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..
Philip M is offline   Reply With Quote
Old 07-13-2002, 03:50 PM   PM User | #5
redhead
Regular Coder

 
Join Date: Jun 2002
Location: United Kingdom Confused: Often
Posts: 859
Thanks: 0
Thanked 0 Times in 0 Posts
redhead is an unknown quantity at this point
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
redhead is offline   Reply With Quote
Old 07-15-2002, 11:07 PM   PM User | #6
Jeepers
Regular Coder

 
Join Date: Jun 2002
Location: Conwy. UK
Posts: 122
Thanks: 0
Thanked 0 Times in 0 Posts
Jeepers is an unknown quantity at this point
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!
Jeepers is offline   Reply With Quote
Reply

Bookmarks

Jump To Top of Thread


Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off

Forum Jump


All times are GMT +1. The time now is 09:43 PM.


Advertisement
Log in to turn off these ads.