my $CR = "\r\n"; ## This should be what your sendmail accepts. ## sendmail will use the correct $CR for the recipient(s) open ( MAIL, ">", $out_email )|| die " Not open $out_email $!\n"; ## Mail Header print MAIL "To: $to$CR"; print MAIL "From: $from$CR"; print MAIL "Subject: $subject$CR"; print MAIL "MIME-Version: 1.0$CR"; print MAIL "Content-Type: text/html; charset=utf-8;$CR"; print MAIL "$CR"; ## "end of headers" ## Mail Body print MAIL "
$CR"; print MAIL "This is a test mail$CR"; print MAIL "
$CR"; print MAIL "$CR"; ## "end of body" close(MAIL); my $conf = "-C /etc/mail/alt_sendmail.cf"; ## Optional if the standard is okay! my $smail = "/usr/sbin/sendmail $conf -bm -v -t < $out_mail 1>>/dev/null 2>>/dev/null /&"; system($smail);