Anonymous Monk has asked for the wisdom of the Perl Monks concerning the following question:

This worked on one server with no problems! It simply gave me a message saying Mail server was down when "sendmail" was not available. Now when I switch the same to another server (with higher securiry) it no longer calls this subroutine and wont work. Both servers are Solaris 7. Any suggestions??
use CGI::Carp qw(fatalsToBrowser); sub mailFatal { print "Content-type: text/html\n\n"; print "<html><head><title>Mail</title></head>\n"; print "<body bgcolor=\"white\">\n"; print "<center><strong><h2><font color=red>Mail Server is not availab +le at this time.</font></h2 ></strong></center>\n"; print "<br><br><center>Email down</center>"; print "</body></html>\n"; exit; } open (MAIL,"|$sendmail") || mailFatal(); #sendmail stuff here close MAIL || mailFatal();

Replies are listed 'Best First'.
Re: Works on one server but not other.
by jdporter (Paladin) on Nov 26, 2002 at 17:22 UTC
    First thing I would recommend is not calling sendmail directly. It may work, but it's not portable. If you use a good module like Mail::Sendmail, you can probably avoid the problem you're running into, and also any portability-related issues. It's worth a try.

    jdporter
    ...porque es dificil estar guapo y blanco.