RSS feed

Sending mail from Perl

December 3rd, 2008 | Posted in Linux, Perl | No Comments

I am using this as a skeleton in various scripts where I need to be notified of errors or successful runs…

#!/usr/bin/perl

    open(MAIL,"|/usr/lib/sendmail -t");

     print MAIL "To: you\@domain.com\n";
     print MAIL "From: name \n";
     print MAIL "Subject: your subject\n\n";
     print MAIL "\nnotification\n";

    close (MAIL);


No Comments to “Sending mail from Perl”

There are no comments yet, add one below.


Leave a Comment






Categories