email.pl
上一篇 /
下一篇 2008-11-12 15:01:55
/ 个人分类:Perl silent installation
use Net::SMTP;
my $smtpSer = 'mailhost';
my $from = 'from@xxx.com';
my $to = 'to@xxx.com';
my $subject = 'Daily check the Pan INM release @'.`date /T`;
my $body = "";
open FILE, "< checkRelease.log"
or die "Can't open the file: checkRelease.log! ($!)";
while (<FILE>) {
$body = "$body$_";
}
close FILE;
$smtp = Net::SMTP->new($smtpSer);
$smtp->mail($ENV{USER});
$smtp->to($to);
$smtp->data();
$smtp->datasend("From: $from\n");
$smtp->datasend("To: $to\n");
$smtp->datasend("Subject: $subject\n");
$smtp->datasend("$body\n-Yourname");
$smtp->dataend();
$smtp->quit;
收藏
举报
TAG:
Perl
email