Click to See Complete Forum and Search --> : mail form results


Pyrohavoc
03-10-2003, 04:16 PM
can someone recommend a good script that would use sendmail on a unix server to email the results to a preset email address that also allows you to customize the "from" address ......????

Nedals
03-10-2003, 05:03 PM
Why would you want to do that? Sounds fishy!! :(

Pyrohavoc
03-10-2003, 05:50 PM
lemme explain.......i currently master two sites and i've got a couple more clients on the way and of the two sites i already take care of one wants a feedback form with results mailed to them at their address so i want to be able to customize the cgi for each url to send the form info to another addy and i need the from address to be able to be modified in the same way so that they know that the email is being sent to them from their site.........the other site wants something similar but i'd like to use to differently customized cgi's so that they show different addresses so the client knows where it's coming from........understand???? good cuz i think i even confused myself:D

DaiWelsh
03-12-2003, 09:45 AM
I have a simple script I use that allows forms to mail to different 'to' addresses based on a code passed from the form e.g.

xxx= address1
yyy = address2

etc.

The from address is also passed from the form as this is not a security issue (afaik). I have a second v simple script to maintain the text file wiht the code -> address look-up online, though I seem to recall it requires write access somewhere in order to create and maintain the text file - not sure if that would be a problem for you?

Anyway I wrote it a long time ago so it would have to be 'no warranty' but I can dig it out if you are interested...

Dai

Nedals
03-12-2003, 12:51 PM
Is this what you want?

sub Email {
my ($to,$from,$subject,$message) = @_;
my $mailprog = '/usr/lib/sendmail'; # Set to your UNIX mail handler
open(MAIL,"|$mailprog -oi -t") || die "Could not open the UNIX email program";
print MAIL "From: $from\n";
print MAIL "To: $to\n";
print MAIL "Subject: $subject\n";
print MAIL "Reply-to: $from\n";
print MAIL "$message\n";
close(MAIL);
}

Damien
03-12-2003, 03:02 PM
The script that might suit your is called Bizmail. It can send to two different addresses and writes to a text file database aswell. It allows you to customise the reply address.

Do a search on http://cgi-resources.com using bizmail as the keyword.

Pyrohavoc
03-12-2003, 03:16 PM
thanks guys i appreciate your help i was about to start doing it the hard way until damien posted.......i appreciate that bizmail link it's exactly what i was looking for......thanks man