open (MAIL,"| /usr/sbin/sendmail || die "$!";) my $to='joe@here.com'; my $from='smith@here.com'; print MAIL << "EOF"; To: $to From: $from Subject: data subject message body here EOF close MAIL || die "$!";