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";