$subject = "Mail Message"; $to = "name@server.com"; open(MAIL, "|mail -s '$subject' $to"); print MAIL "message body" print MAIL "\n.\n"; # to quit close(MAIL);