7 our @EXPORT = qw(&sendMail);
9 checkConf( [ 'from_addr', 'sendmail' ] );
10 defConf( { 'sendmail' => '/usr/sbin/sendmail' } );
13 my( $to, $subject, $body ) = @_;
14 my( $from, $sendmail ) = confList( [ 'from_addr', 'sendmail' ] );
15 $body =~ s/^\.$/../gm;
16 open SENDMAIL, "|$sendmail -f$from $to" or die 'Can not send mail';
17 print SENDMAIL "From: $from\n".
19 "Subject: $subject\n".
20 "Content-Type: text/plain; charset=\"utf8\"\n".
23 close SENDMAIL or die "Sending mail failed: $!, $?";