deliver_complete.pl
复制内容到剪贴板
代码:
use Net::SMTP;
my $from ='ccadm@rational.com'; # from mail account
my $site = 'test.rd.com'; # mail server
my $smtp_host = 'test.rd.com'; # connect to an SMTP server
my $to ='pm01@rational.com'; # to mail account
my $smtp =Net::SMTP->new($smtp_host,Hello=>$site);
print "begin...";
print $ENV{CLEARCASE_PN};
$smtp->mail($from);
$smtp->to($to);
$smtp->data();
$smtp->datasend("To: $to\n");
my $subject = "Subject: Delivery complete";
$smtp->datasend($subject);
$smtp->datasend("\n");
my $body = join '', ("\n",
"UCM Project: ", $ENV{CLEARCASE_PROJECT}, "\n",
"UCM source stream: ", $ENV{CLEARCASE_SRC_STREAM}, "\n",
"UCM destination stream: ", $ENV{CLEARCASE_STREAM}, "\n",
"UCM integration activity: ", $ENV{CLEARCASE_ACTIVITY}, "\n",
"UCM activities delivered: ", $ENV{CLEARCASE_DLVR_ACTS}, "\n",
"UCM view: ", $ENV{CLEARCASE_VIEW_TAG}, "\n"
);
$smtp->datasend("\n");
$smtp->datasend($body);
$smtp->dataend();
$smtp->quit;