http://qs321.pair.com?node_id=19480

draco_iii has asked for the wisdom of the Perl Monks concerning the following question: (mail and news)

How do you properly use sendmail?

Originally posted as a Categorized Question.

Replies are listed 'Best First'.
Re: How do you properly use sendmail?
by davorg (Chancellor) on Jun 23, 2000 at 14:07 UTC
Re: How do you properly use sendmail?
by Juerd (Abbot) on Aug 05, 2003 at 06:56 UTC
    my $mailer = '/usr/sbin/sendmail -t -oi'; my $recipient = 'foo@bar.com'; my $message = '...'; open my $mailer, "|$mailer" or die $!; print $mailer <<"END" or die $!; From: user\@domain.com To: $recipient Subject: Testing 123 $message END close $mailer or die $!;
    Remember to make sure all data that goes into the headers (just $recipient in this example) is valid.