Eek! I've been told by my ISP that my Perl script to email myself and the user of my form the contents on my contact form has been hijacked by a spammer. My ISP has been deluged by recipients with complaints. Where have I gone wrong? Please be kind, this is a beginners' list after all.


#!/usr/local/bin/perl -wT
use CGI::Carp qw(fatalsToBrowser);
use strict;
use CGI;
my $cgiobj = new CGI;
$ENV{PATH} = "";

#Get parameters
my $name = $cgiobj->param('name');
my $address = $cgiobj->param('address');
my $email = $cgiobj->param('email');
my $comments = $cgiobj->param('comments');

#send emails to Camilo and sender
my $from ='Opensourceman';
my $subject = 'Contact Confirmation from Opensourceman';
my $reply = '[EMAIL PROTECTED]';
my $sendmail = '/usr/lib/sendmail -i -t';
open (SENDMAIL, "|$sendmail") or die "Cannot open sendmail: $!";
print SENDMAIL "To: $email, $reply\n";
print SENDMAIL "From: $from\n";
print SENDMAIL "Reply-to: $reply\n";
print SENDMAIL "Subject: $subject";
print SENDMAIL "\n\n";
print SENDMAIL "Thanks for contacting Opensourceman. Below is what you submitted to us:\n
Name: $name\n
Address: $address\n
Email: $email\n
Comments: $comments \n\n We will be contacting you shortly";
close(SENDMAIL);



-- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED] <http://learn.perl.org/> <http://learn.perl.org/first-response>




Reply via email to