in reply to Mailer not mailing.

toonski,
Two things pop out at me:
open (MAIL, "|/usr/sbin/sendmail -oi -t") or die $!; # check to see i +f a success print MAIL 'To: myemail@myemail.com\n'; # double quotes i +nterpolate @myemail as a variable
You don't provide any errors so I am assuming that you do not have warnings turned on or that you are checking the return code of your open statement.

You could always install Mail::Sendmail. In case you are wondering how to do that without root privelages - it's a FAQ

Cheers - L~R

Replies are listed 'Best First'.
Re: Re: Mailer not mailing.
by toonski (Beadle) on Jan 22, 2004 at 18:55 UTC
    Thank you for your quick response. I added your suggestions, but the results are still the same. it acts like it sent it and nothing is sent. here is the updated, full, code.
    #!/usr/bin/perl use strict; use warnings; use CGI ":all"; use CGI::Carp qw(fatalsToBrowser set_message); BEGIN { sub handle_errors { my $msg = shift; print "<h1>ERROR</h1><br>"; print "$msg" } set_message(\&handle_errors); } open(MAIL,'|/usr/sbin/sendmail -oi -t') or die $!; print MAIL 'To: myemail\@myemail.com\n'; print MAIL 'From: serveremail\@theserver.com\n'; print MAIL 'Subject: Blah\n\n'; print MAIL 'Put main message in here.\n'; close (MAIL); print header, "hi";
      toonski,
      You combined b10m and my suggestions. Either use single quotes which won't interpolate or escape the ampersands in the double quotes.

      it acts like it sent it and nothing is sent

      What do you mean? Are you saying there is no error messages but you do not receive the email? If that is the case, have you tried doing checking the mailq? Have you tried running the same process from the command line? You are not giving enough feedback to indicate what the problem is.

      Cheers - L~R

        Sorry. Yes, it acts like it send, as in no errors. I dont have a commandline, and I dont know what a mailq is. I wish I knew more about it. I took out the slashes, but the result hasnt changed. What is mailq?