I have written the following program to send e-mail to those who fill out a form. However, it does not send the subject and the e-mail address with the message. The same statements work in other programs. Please help.
$mailprog ='/usr/lib/sendmail';
$recipient ="sales\@test.com";
$subject = "sale";
open (MAIL, "| $mailprog $recipient") or die "Could not open Mailprogram:";
print MAIL "TO: $recipient\n";
print MAIL "FROM: $FORM{'email'}\n";
print MAIL "Subject : $subject\n";
print MAIL "Sale Site - Sale\n ";
print MAIL "Ad from $FORM{'name'} $FORM{'address'} $FORM{'city'}";
print MAIL "$FORM{'state'} $FORM{'zipcode'}.\n";
print MAIL "You are selling $FORM{'make'} model $FORM{'model'} with $FORM{'color'} color and $FORM{'mile'}";
print MAIL " miles year $FORM{'year'} for $d $FORM{'price'} with your description $FORM{'comment'}";
print MAIL " photo included $FORM{'photo'}\n";
close (MAIL);
$mailprog ='/usr/lib/sendmail';
$recipient ="sales\@test.com";
open (MAIL, "| $mailprog $FORM{'email'}") or die "Could not open Mailprogram:";
print MAIL "TO: $FORM{'email'}\n";
print MAIL "FROM: $recipient\n";
print MAIL "Subject : Sale\n";
print MAIL "For Sale\n";
print MAIL "On day and date: $today: $thismon-$mday-$year \n";
print MAIL "You have provided this information:\n";
print MAIL "Your name : $FORM{'name'}. Your address: $FORM{'address'} $FORM{'city'}\n";
print MAIL "$FORM{'state'} $FORM{'zipcode'}\n";
print MAIL "You phone : $FORM{'telephone'} to call you between $FORM{'time'} \n";
print MAIL "You are selling $FORM{'make'} model $FORM{'model'} with $FORM{'color'} color and $FORM{'mile'} miles of year $FORM{'year'} for $d $FORM{'price'} with your description $FORM{'comment'} \n";
print MAIL " \n";
close (MAIL);
$mailprog ='/usr/lib/sendmail';
$recipient ="sales\@test.com";
$subject = "sale";
open (MAIL, "| $mailprog $recipient") or die "Could not open Mailprogram:";
print MAIL "TO: $recipient\n";
print MAIL "FROM: $FORM{'email'}\n";
print MAIL "Subject : $subject\n";
print MAIL "Sale Site - Sale\n ";
print MAIL "Ad from $FORM{'name'} $FORM{'address'} $FORM{'city'}";
print MAIL "$FORM{'state'} $FORM{'zipcode'}.\n";
print MAIL "You are selling $FORM{'make'} model $FORM{'model'} with $FORM{'color'} color and $FORM{'mile'}";
print MAIL " miles year $FORM{'year'} for $d $FORM{'price'} with your description $FORM{'comment'}";
print MAIL " photo included $FORM{'photo'}\n";
close (MAIL);
$mailprog ='/usr/lib/sendmail';
$recipient ="sales\@test.com";
open (MAIL, "| $mailprog $FORM{'email'}") or die "Could not open Mailprogram:";
print MAIL "TO: $FORM{'email'}\n";
print MAIL "FROM: $recipient\n";
print MAIL "Subject : Sale\n";
print MAIL "For Sale\n";
print MAIL "On day and date: $today: $thismon-$mday-$year \n";
print MAIL "You have provided this information:\n";
print MAIL "Your name : $FORM{'name'}. Your address: $FORM{'address'} $FORM{'city'}\n";
print MAIL "$FORM{'state'} $FORM{'zipcode'}\n";
print MAIL "You phone : $FORM{'telephone'} to call you between $FORM{'time'} \n";
print MAIL "You are selling $FORM{'make'} model $FORM{'model'} with $FORM{'color'} color and $FORM{'mile'} miles of year $FORM{'year'} for $d $FORM{'price'} with your description $FORM{'comment'} \n";
print MAIL " \n";
close (MAIL);