Sendmail Issue

Status
Not open for further replies.

nieroda

New Member
Messages
3
Reaction score
0
Points
1
I am using a .cgi script to sendmail for forms \usr\sbin\sendmail and all of a sudden the script is no longer working. Can you please provide some insight into why this may be and suggest any detailed solutions to resolve my issue.
Regards
 

dlukin

New Member
Messages
427
Reaction score
25
Points
0
Code:
#! /usr/bin/perl

use CGI::Carp qw(fatalsToBrowser);
use strict ;

my $sendmail = "/usr/sbin/sendmail -t";
my $send_to  = "To: target\@gmail.com\n";
my $from    = "From: myuser\@mydomain.x10hosting.com\n";
my $subject  = "Subject: PERL/SENDMAIL TEST\n\n";

my @it = getpwuid( $> ) ;

open(SENDMAIL, "|$sendmail") or die "Cannot open $sendmail: $!";
print SENDMAIL $send_to;
print SENDMAIL $from;
print SENDMAIL $subject;

print SENDMAIL "Test script sending cron job/web  via perl. Info: @it";
close(SENDMAIL);


print "Content-type: text/html\n\n";
print "<HTML>\n";
print "<HEAD><TITLE>Hello World!</TITLE></HEAD>\n";
print "<BODY>\n";
print "<H2>Hello World!</H2>  <br /> \n";
print "<H3>UID: $> effective  $< real @it</H3>" ;

my ($sec,$min,$hour,$mday,$mon,$year,$wday,
$yday,$isdst)=localtime(time);
printf "\n%4d-%02d-%02d %02d:%02d:%02d\n",$year+1900,$mon+1,$mday,$hour,$min,$sec;


foreach my $key (sort keys(%ENV)) {
  print "\n<p>$key = $ENV{$key}</p>" ;
}

print "</BODY>\n";
print "</HTML>\n\n\n\n";

This works for me both as a cron job and from the web.

Without looking at your code, it is hard to pinpoint any source of your problem.
 

nieroda

New Member
Messages
3
Reaction score
0
Points
1
I tried your cgi script and it also isn't working with my site. Is it possible x10 blocked the sendmail command?
 
Status
Not open for further replies.
Top