- Prison Code Breaker Diary -

=> aka: Nhật Kí Code Tù

Categories

This is a small tip about sending mails via Perl code.


sub mail {
my( $to, $from, $sub, $msg ) = @_;
my( $send ) = "/usr/lib/sendmail";

open MAIL, "| $send -oi -t";
print MAIL "From: $from\n";
print MAIL "To: $to\n";
print MAIL "Subject: $sub\n\n";
print MAIL "$msg\n";
close MAIL;
}


Have fun!@

0 comments

Post a Comment