if (open (SENDMAIL, "| $sendmailpath -t")) { print SENDMAIL "Subject: $subject\n"; print SENDMAIL "From: $from\n"; print SENDMAIL "To: $to\n"; print SENDMAIL "\n" ### Need a blank line between headers and body! print SENDMAIL "This is a test e-mail.\n\n"; close (SENDMAIL);