Helpful Information
 
 
Category: Perl Programming
Mail cgi not working help please

#!/usr/local/bin/perl

use CGI;
$q = new CGI;

$fname= $q->param('fname');
$fname= $q->param('sname');
$initials = $q->param('initials');
$title = $q->param('title');

$mail = '1';
$mailprog = '/var/qmail/bin/qmail-inject';
$recipient = 'c.dyason@ponl.com';
$email = 'chrisdice4@yahoo.com';

if ($mail eq '1') {
open (MAIL, "|$mailprog $recipient") | | die "Can't open $mailprog!n";

print MAIL "Reply-to: $emailn";
print MAIL "From: $email n";
print MAIL "Subject: Bond Applicationnn";
print MAIL "Succesfull Bond Applicant:nn";
print MAIL "------------------------------------------------------n";
print MAIL "this is a testn";
print MAIL "this is a test";

if ( $fname ){
print MAIL " <$fname>";
}

print MAIL "n";

if ( $sname ){
print MAIL "<$sname>";
}

if ( $initials){
print MAIL " <$initials>";
}

if ( $initials){
print MAIL " <$title>";
}
}

Haven't checked this out but 2 things occur to me

close (MAIL);

at the end

also should the recipient appear as

print MAIL "To: $recipientn"

and the open mail be something like this

open (MAIL, "| $mailprog -t -oi") | | die "Can't open $mailprog ! $_n";



[This message has been edited by des (edited December 06, 2000).]










privacy (GDPR)