sub mail { my ($changed,$updated) = @_; my $t = Template->new; my $to = 'xxx@xxx.com'; my $subject = "Webchanges Detected - $date"; my $body = <

Changes Detected :



Changed Values :


Updated Values : EOF $t->process(\$body, { list1 => \@{$changed}, list2 => \@{$updated} }, \*STDOUT); my $msg = MIME::Lite->new( From => 'xxx@xxx.com', To => $to, Subject => $subject, Type => 'text/html', Data => $body, ) or die "Error creating multipart container: $!\n"; $msg->send or die "Failed To Send!: $!\n"; print "Message sent!\n"; }