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

 

评分:0

我来说两句

日历

« 2024-05-15  
   1234
567891011
12131415161718
19202122232425
262728293031 

数据统计

  • 访问量: 48341
  • 日志数: 80
  • 建立时间: 2008-10-27
  • 更新时间: 2009-07-17

RSS订阅

Open Toolbar