Front page | perl.perl5.porters |
Postings from April 2000
perl execution problem
Thread Next
From:
Gavin Minor
Date:
April 12, 2000 23:30
Subject:
perl execution problem
Message ID:
20000413062956.78923.qmail@hotmail.com
The following code, when executed, does not work. It returns an error
message "Couldn't finish running sendmail: aborting at sendmail.cgi line
28." (note line 28 is the close(SENDMAIL) line)
Can anyone suggest why this may not be working?
SFLA
----------
#!/usr/bin/perl
use CGI;
use CGI::Carp qw(fatalsToBrowser);
my $sendmail = "/usr/sbin/sendmail -t";
my $reply_to = 'someone@virtualave.net';
my $subject = "Test Email";
my $content = "This is a Test Email";
my $to = 'sfla@hotmail.com';
my $from = 'sfla@hotmail.com';
print "Content-Type: text/html\n\n";
print "<html> <head>\n";
print "<title>Sending Mail</title>\n";
print "</head>\n";
print "<body>\n";
print "Your email is being sent...\n";
open(SENDMAIL, "| $sendmail") or die "Cannot open $sendmail: $!";
print SENDMAIL "To: $to\n";
print SENDMAIL "From: $from\n";
print SENDMAIL "Reply-to: $reply_to\n";
print SENDMAIL "X-Mailer: Perl Powered Socket Mailer\n";
print SENDMAIL "Subject: $subject\n\n";
print SENDMAIL "$content";
print SENDMAIL "\n.\n";
close(SENDMAIL) or die "Couldn't finish running sendmail: $! aborting";
print "Email has been Sent\n";
print "</body> </html>\n";
______________________________________________________
Get Your Private, Free Email at http://www.hotmail.com
Thread Next
-
perl execution problem
by Gavin Minor