in reply to Re^2: close statement issue
in thread close statement issue

Thanks, I tried all suggestions and it still only works if I get rid of the close statement. Any other suggestions?

Replies are listed 'Best First'.
Re^4: close statement issue
by almut (Canon) on Mar 01, 2007 at 19:04 UTC

    Don't you get any more detailed error message than "mail not working"? (look in the syslog, MTA logfiles, etc.)

    Anyhow, something like this works fine for me (my incarnation of sendmail needs the -t option to read the addressees from the message headers...):

    #!/usr/bin/perl open MAIL, "| /usr/sbin/sendmail -t" or die "$!"; print MAIL << 'EOF'; To: joe@here.com From: smith@here.com Subject: data subject message body here EOF close MAIL or die "$!";