Blat works from command line but not in CGI script 
Author Message
 Blat works from command line but not in CGI script

Quote:

> I have an NT Server with Exchange 5.5 and IIS 4 installed. I've installed
> Blat to e-mail the contents of web site CGI forms to me. I can't get it to
> work. I can use blat from the command prompt to send me a text file just
> fine, but it won't work from the PERL script.

> I have the PERL scripts setup so that after the contents of the form have
> been e-mailed to me, HTML is returned to the screen. This happens, so I'm
> not sure what's going on. What follows is the first part of the script and
> the part of the script that involes blat. Any suggestions would be
> appreciated.

> Thank you,

> Matthew Cate

> #! D:\perl\bin\perl.exe
> require 'D:\perl\lib\cgi-lib.pl';
> &ReadParse (*in);
> print "Content-type: text/html\n\n";

> open (MAIL, ">temp$$");

> print MAIL <<EOF;

> Browser: $ENV{'HTTP_USER_AGENT'}

> Name: $in{'name'}

> EOF
> ;

> close (MAIL);


> system ("del temp$$");

If I may quote Larry Wall:

Always check the return code of system calls.
Always check the return code of system calls.
ALWAYS CHECK THE RETURN CODE OF SYSTEM CALLS!

This could give you your answer.  I have known some versions of IIS
to refuse to run other programs via a system().  If this is your
problem, one way to fix it is to use the Net::SMTP module instead
of blat.  This is a better solution for several reasons.  You
can get all the info you need about this module by running
"perldoc Net::SMTP" at a DOS prompt. This assumes you have the latest
Perl 5.004.02 installed.  

HTH - Jim Bowlin



Sun, 26 Nov 2000 03:00:00 GMT  
 Blat works from command line but not in CGI script

I have an NT Server with Exchange 5.5 and IIS 4 installed. I've installed
Blat to e-mail the contents of web site CGI forms to me. I can't get it to
work. I can use blat from the command prompt to send me a text file just
fine, but it won't work from the PERL script.

I have the PERL scripts setup so that after the contents of the form have
been e-mailed to me, HTML is returned to the screen. This happens, so I'm
not sure what's going on. What follows is the first part of the script and
the part of the script that involes blat. Any suggestions would be
appreciated.

Thank you,

Matthew Cate

#! D:\perl\bin\perl.exe
require 'D:\perl\lib\cgi-lib.pl';
&ReadParse (*in);
print "Content-type: text/html\n\n";

open (MAIL, ">temp$$");

print MAIL <<EOF;

Browser: $ENV{'HTTP_USER_AGENT'}

Name: $in{'name'}

EOF
;

close (MAIL);


system ("del temp$$");



Mon, 27 Nov 2000 03:00:00 GMT  
 
 [ 2 post ] 

 Relevant Pages 

1. My <!--#exec cgi="\scripts\script.pl"-->command will not work

2. System call works at command line but not within CGI

3. -F works on command line but not on #!perl -paF line

4. command line args not working correctly

5. system call works in command line mode but not from web

6. perl - NT and blat command line switches

7. work on command line and not via browser?

8. perl program works on command line, but not when run through www server

9. CGI.pm not askking for vbls from command line

10. DBM problem from CGI, not command line

11. CGI.pm not looking at command line

12. system() command not wrking in cgi / works fine in .pl

 

 
Powered by phpBB® Forum Software