#!/usr/local/bin/perl
use strict;
use warnings;
use sendmail;
use POSIX;
my $html;
my $cnt = 0;
my $dte = strftime "%A, %B %d, %Y - %T", localtime;
open IN, "tix_file" or die "could not open tix_file: $!";
$html .= "<html>\n<body>\n";
$html .= "<h1>Ticket Report</h1>\n";
while (<IN>)
{
chomp;
$cnt++;
my $url = "https://ibjira.uk.mmm.com/jira/browse/$_";
$html .= "<a href=\"$url\">Ticket $_</a><br />\n";
}
$html .= "<hr />\n";
$html .= "found $cnt records<br />\n";
$html .= "</body>\n</html>\n";
close IN;
# configure email options
my $sendto = '[email protected], [email protected]';
my $from = "Automated Email";
my $subject = "Ticket Report for $dte";
sendmail($sendto, $from, $subject, $html);
exit;
|