Hellow:
According to CGI Programming 101, guestbook.cgi can sendmail to me, but not called by guestbook.html. bellow is my script, could someone give me idea?
========guestbook.cgi===========
#!/usr/bin/perl -wT
use CGI qw(:standard);
use CGI::Carp qw(warningsToBrowser fatalsToBrowser);
use strict;
print header;
print start_html("Results");
$ENV{PATH} = "/usr/sbin";
open (MAIL, "|/usr/sbin/sendmail -oi -t ");
my $recipient = 'centos6test@gmail.com';
print MAIL "To: $recipient\n";
print MAIL "From: centos6test\@gmail.com\n";
print MAIL "Subject: Form Data\n\n";
foreach my $p (param()) {
print MAIL "$p = ", param($p), "\n";
}
close(MAIL);
print <<EndHTML;
<h2>Thank You</h2>
<p>Thank you for writing!</p>
<p>Return to our <a href="/guestbook.html">home page</a></p>
EndHTML
print end_html;
=========guestbook.html===========
<html><head><title>Guestbook Form</title></head>
<body>
<form action="cgi-bin/guestbook.cgi" method="POST">
Your Name: <input type="text" name="name"><br>
Email Address: <input type="text" name="email"><br>
<textarea name="comments" rows="5" cols="60"></textarea><br>
<input type="submit" value="Send">
</form>
</body>
</html>