in reply to Re: sendmail with perl
in thread sendmail with perl

OK, I was a bit brief on the code that I actually use. Here's the perl code:
$mailProg = "/usr/sbin/sendmail -t"; open (MAIL, "|$mailProg"); print MAIL "Date: $mailheader_date -0500\n"; print MAIL "To: $recipient\n"; print MAIL "From: $adminEmail\n"; print MAIL "Subject: Borrow Request\n"; print MAIL "***********************************\n"; (more print statements with the body of the msg in here) close (MAIL);

So yes, it could be that I'm doing it the wrong way .... although this has worked for a long time on a lot of different servers. :)

What call to the sendmail program would work then, if it should have something else for the envelope besides what's in the body?

Replies are listed 'Best First'.
Re^3: sendmail with perl
by jettero (Monsignor) on May 24, 2007 at 02:26 UTC
    Yes, that works acceptably well. It's not wrong... It's not really perl though. And I definitely don't know how to send to more than one recipient that way. When I'm doing bigger jobs, I always use Net::SMTP. A lot of people like MIME::Lite too, so I'd check there. I believe it forks a sendmail in some modes.

    -Paul

      Are Net::SMTP & MIME::Lite installed by default with Perl 5?

      (Where would I look to find that out ... that's a question I often have before using a module. I need to not be something that has to be installed by the ISP later on - since they don't often like to do that).

      Michael

Re^3: sendmail with perl
by Anonymous Monk on May 24, 2007 at 11:31 UTC