This is the program I am using for SENDMAIL. Surprisingly it is not dying.
I could see an error message in the browser as "The System cannot find the path 
specified". I donno from where the message is coming..

I removed the SENDMAIL part and then checked, now the error is not coming....I 
am sure it is with the sendmail. Is it some thing to do with the sendmail.

Any other module which will accomplisj the task....



#!/usr/local/bin/perl
use strict;
use warnings;
use CGI;

my $cgi=new CGI;
print $cgi->header();
my $name = &clean($cgi->param('name')); // THIS IS FROM THE html FILE
my $age = &clean($cgi->param('age'));   // THIS IS FROM THE html FILE

my $sendmail = "/usr/sbin/sendmail -t";
my $reply_to = "Reply-to: [EMAIL PROTECTED]";
my $subject  = "Subject: Confirmation of your submission";
my $content  = "Thanks for your submission.";
my $to       = "[EMAIL PROTECTED]";

unless ($to) {
  print $cgi->header;
  print "Please fill in your email and try again";
}

open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
print SENDMAIL $reply_to;
print SENDMAIL $subject;
print SENDMAIL $to;
print SENDMAIL "Content-type: text/plain\n\n";
print SENDMAIL $name;
print SENDMAIL $description;
close(SENDMAIL);

print $cgi->header;
print "Confirmation of your submission will be emailed to you.";

sub clean
{
 # Clean up any leading and trailing whitespace
 # using regular expressions.
 my $s = shift @_;
 $s =~ s/^\s+//;
 $s =~ s/\s+$//;
 return $s;
}


Reply via email to