einerwitzen has asked for the wisdom of the Perl Monks concerning the following question:
I'm just trying to figure out how to make an email script, I pieced this together, it doesn't have any errors when I run it in Unix but I get an error 500 when I have a form submit to it online. Let me know what to do, Thanks!
#!/usr/bin/perl use CGI qw/:standard/; $to = "webmaster\@3dwc.com"; $from = "Customer\@fast-trak.com"; $subject = "Online Repair Status Inquiry"; $ok_url = "/thanks.html"; $bad_url = "/nogo.html"; $firstname=param('firstname'); $lastname=param('lastname'); $phone=param('phone'); $phone2=param('phone2'); $email=param('email'); $brand=param('brand'); $model=param('model'); $serial=param('serial'); $service=param('service'); @comments=param('comments'); open(MAIL, "|/usr/lib/sendmail -t") || die "cant run sendmail"; print MAIL "To: $to \n"; print MAIL "From: $from ($firstname)\n"; print MAIL "Subject: $subject \n\n"; print MAIL "$firstname"; print MAIL "$lastname"; print MAIL "$phone"; print MAIL "$phone2"; print MAIL "$email"; print MAIL "$brand"; print MAIL "$model"; print MAIL "$serial"; print MAIL "$service"; print MAIL "@comments"; close(MAIL); print "Location: $ok_url";
|
---|
Replies are listed 'Best First'. | |
---|---|
• WARNING security hole was (Re: Simple Email Script)
by merlyn (Sage) on Mar 07, 2002 at 19:31 UTC | |
Re: Simple Email Script
by dorko (Prior) on Mar 07, 2002 at 19:34 UTC | |
by dws (Chancellor) on Mar 07, 2002 at 19:38 UTC | |
Re: Simple Email Script
by mrbbking (Hermit) on Mar 07, 2002 at 21:14 UTC | |
by theguvnor (Chaplain) on Mar 08, 2002 at 02:59 UTC | |
by gellyfish (Monsignor) on Mar 09, 2002 at 15:50 UTC | |
Re: Simple Email Script
by gellyfish (Monsignor) on Mar 07, 2002 at 21:20 UTC | |
Re: Simple Email Script
by silent11 (Vicar) on Mar 07, 2002 at 19:54 UTC | |
Re: Simple Email Script
by einerwitzen (Sexton) on Mar 07, 2002 at 19:21 UTC |
Back to
Seekers of Perl Wisdom