pues eso chicos q me sale error, os reporto codigo en 2 partes, yo uso mercury mail , no se si tendre que descargarme el sendmail
Código perl:
Ver original1.Insecure $ENV{PATH} while running with -T switch at line 7, line 1.
#!/usr/bin/perl
$header = "header.html";
$footer = "footer.html";
$mailprogram = "/usr/lib/sendmail -t"; MERCURY MAIL ???
$returnpage = "/";
$youremail = "freecart\@nopdesign.com";
$csvfilename = "orders.csv";
$csvquote = "\"\"";
$mode = "FILE";
@required = (
'b_first',
'b_last',
'b_addr',
'b_city',
'b_state',
'b_zip',
'b_phone',
'b_email'
);
sub urlDecode {
my ($string) = @_;
$string =~ tr/+/ /;
$string =~ s/%([\dA-Fa-f][\dA-Fa-f])/pack ("C", hex($1))/eg;
$string =~ s/['"]/\'/g;
}
sub processCGI {
local ($cgiData, $key, $value, $pair, @pairs);
if ($ENV{'REQUEST_METHOD'} eq 'GET') { $cgiData = $ENV{'QUERY_STRING'}; }
else { $cgiData = <STDIN>; }
@pairs = split (/&/, $cgiData); foreach $pair (@pairs) {
($key, $value) = split (/\=/, $pair); $key = &urlDecode($key);
$value = &urlDecode($value);
${$key} .= ", ".$value;
}else{
${$key} = $value;
}
}
}
sub doFormError {
my ($errString) = @_;
@LINES = <HEAD>;
print "Content-type: text/html\n\n";
print "<FONT SIZE=+2>The form you submitted was not complete.<BR><BR></FONT>"; print "$errString<BR><BR>\n"; print "<INPUT TYPE=BUTTON ONCLICK='history.back()' VALUE=' Return to the checkout page '><HR>";
@LINES = <FOOT>;
}
sub doError {
my ($errString) = @_;
print "Content-type: text/html\n\n";
@LINES = <HEAD>;
print "$errString<BR><BR>\n";
@LINES = <FOOT>;
sub invalidE {
my ($szEmail) = @_;
my ($user, $host);
$szEmail =~ tr/A-Z/a-z/;
if ($szEmail =~ /\s/) { return 1; } ($user, $host) = split (/\@/, $szEmail); if ($host =~ /compuserve/i) { ; }
else {
if (! $user =~ /\D/) { return 1; } if (! $host =~ /\D/) { return 1; } }
if ($szEmail =~ /\w+\@[\w|\.]/) { return 0; } }
sub populateDateVar {
@months = ();
push(@months,"February"); push(@months,"September"); push(@months,"November"); push(@months,"December"); @days = ();
($sec,$min,$hour,$day,$month,$year,$day2) =
if ($sec < 10) { $sec = "0$sec"; }
if ($min < 10) { $min = "0$min"; }
if ($hour < 10) { $hour = "0$hour"; }
if ($day < 10) { $day = "0$day"; }
$year += "1900";
&processCGI;
&populateDateVar;
foreach $check(@required) {
unless ($check) {
doFormError("It appears that you forgot to fill in the <strong>$check</strong> field.");
}
}
if( &invalidE($b_email) ){
doFormError('su e-mail no es correcto.');
}
if( $mode eq "BOTH" || $mode eq "EMAIL") {
open (MAIL
,"|$mailprogram"); AKI ESTA EL ERROR
print MAIL
"To: $youremail\n"; print MAIL
"From: $b_email\n"; print MAIL
"Subject: New Online Order\n"; print MAIL
"A new order has been received. A summary of this order appears below.\n"; print MAIL
"Order Date: $months[$month] $day, $year $hour:$min:$sec \n"; print MAIL
"Bill To: \n"; print MAIL
" $b_first $b_last \n"; print MAIL
" $b_addr \n"; print MAIL
" $b_addr2 \n"; print MAIL
" $b_city, $b_state $b_zip \n"; print MAIL
" $b_phone \n"; print MAIL
" $b_email \n"; print MAIL
"Ship To: \n"; print MAIL
" $s_first $s_last \n"; print MAIL
" $s_addr \n"; print MAIL
" $s_addr2 \n"; print MAIL
" $s_city, $s_state $s_zip \n"; print MAIL
" $s_phone \n"; print MAIL
"Qty Price(\$) Product ID - Product Name\n"; print MAIL
"$QUANTITY_1 \$$PRICE_1 $ID_1 - $NAME_1 $ADDTLINFO_1 \n"; if( $NAME_2 ) {print MAIL
"$QUANTITY_2 \$$PRICE_2 $ID_2 - $NAME_2 $ADDTLINFO_2 \n";} if( $NAME_3 ) {print MAIL
"$QUANTITY_3 \$$PRICE_3 $ID_3 - $NAME_3 $ADDTLINFO_3 \n";} if( $NAME_4 ) {print MAIL
"$QUANTITY_4 \$$PRICE_4 $ID_4 - $NAME_4 $ADDTLINFO_4 \n";} if( $NAME_5 ) {print MAIL
"$QUANTITY_5 \$$PRICE_5 $ID_5 - $NAME_5 $ADDTLINFO_5 \n";} if( $NAME_6 ) {print MAIL
"$QUANTITY_6 \$$PRICE_6 $ID_6 - $NAME_6 $ADDTLINFO_6 \n";} if( $NAME_7 ) {print MAIL
"$QUANTITY_7 \$$PRICE_7 $ID_7 - $NAME_7 $ADDTLINFO_7 \n";} if( $NAME_8 ) {print MAIL
"$QUANTITY_8 \$$PRICE_8 $ID_8 - $NAME_8 $ADDTLINFO_8 \n";} if( $NAME_9 ) {print MAIL
"$QUANTITY_9 \$$PRICE_9 $ID_9 - $NAME_9 $ADDTLINFO_9 \n";} if( $NAME_10 ){print MAIL
"$QUANTITY_10 \$$PRICE_10 $ID_10 - $NAME_10 $ADDTLINFO_10 \n";} if( $NAME_11 ){print MAIL
"$QUANTITY_11 \$$PRICE_11 $ID_11 - $NAME_11 $ADDTLINFO_11 \n";} if( $NAME_12 ){print MAIL
"$QUANTITY_12 \$$PRICE_12 $ID_12 - $NAME_12 $ADDTLINFO_12 \n";} if( $NAME_13 ){print MAIL
"$QUANTITY_13 \$$PRICE_13 $ID_13 - $NAME_13 $ADDTLINFO_13 \n";} print MAIL
"SUBTOTAL: $SUBTOTAL \n"; print MAIL
"TOTAL: $TOTAL \n"; print MAIL
"FREIGHT: $SHIPPING \n"; print MAIL
"Comments: \n"; print MAIL
"$comment \n"; }
if( $mode eq "BOTH" || $mode eq "FILE") {