Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations IamaSherpa on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

mail script won't send email anymore...can you find any problem? 1

Status
Not open for further replies.

spewn

Programmer
May 7, 2001
1,034
my hosting co. says it's not them, and the location of their sendmail program is correct. yet still, i cannot receive email, even though no errors come up and i get redirected to the right page...

any help appreciated

**
#!/usr/local/bin/perl

%postInputs = readPostInput();
$dateCommand = "date";
$time = `$dateCommand`;
$sh = $postInputs{'shr'};
$dr = $postInputs{'dir'};
$mn = $postInputs{'mnu'};
$sn = $postInputs{'snv'};
$url = $postInputs{'url1'};
open (MAIL, "|/var/qmail/bin/qmail-inject") || return 0;

select (MAIL);
print << &quot;EOF&quot;;

To: ask\@anymail.net
From: $postInputs{'eml'}
Subject: $postInputs{'sbj'}

Comments: $postInputs{'msg'}

EOF
close(MAIL);
select (STDOUT);
printThankYou();

sub readPostInput(){

my (%searchField, $buffer, $pair, @pairs);
if ($ENV{'REQUEST_METHOD'} eq 'POST'){
read(STDIN, $buffer, $ENV{'CONTENT_LENGTH'} );
@pairs = split(/&/, $buffer);
foreach $pair (@pairs){
($name, $value) = split(/=/, $pair);
$value =~ tr/+/ /;
$value =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(&quot;C&quot;, hex($1))/eg;
$name =~ tr/+/ /;
$name =~ s/%([a-fA-F0-9][a-fA-F0-9])/pack(&quot;C&quot;, hex($1))/eg;
$searchField{ $name} = $value;

}
}

return (%searchField);

}

sub printThankYou(){
print << &quot;EOF&quot;;
Location:
EOF
}

**

it was working previously, but i attempted to rewrite it so i could sending html in the emailk which failed, and after i put it back to the way it was, i noticed the problem...so whether it was there before and i didn't notice, or i did something wrong (most likely); either way, i'm not able to find the error.

thanks...


- spewn
 
I dont know CGi well enough to spot an error but is it viable that you get your backup copy of the file (recommended you have one) and start from scratch again! Once you have it working you can go at your mods again!

sorry no help.
É
 
The only things I can see that might affect it are:

The blank line in front of the To: line. Try taking that out and see what happens.

Your print line looks funny. Trying changing it to:
Code:
print <<EOF;
You don't need the quotes around the end tag (and they might be messing things up), and I don't think you want the space after the << symbol either.

Also, try leaving a blank line after the end (EOF) tag.
Tracy Dryden
tracy@bydisn.com

Meddle not in the affairs of dragons,
For you are crunchy, and good with mustard. [dragon]
 

&quot;...The blank line in front of the To: line. Try taking that out and see what happens...&quot;

thanks.


- spewn
 

yep...

good lookin' out.


- spewn
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top