However, unless your file is HTML your email will be garbled (e.g. it will not display linebreaks properly). If your file is not HTML then there is no need to use Email::MIME::CreateHTML, just use Email::Send:my @lines = <FH>;
use strict; use warnings; use Email::Send; open(FH, "</apps/dryrun-merges/logs/dryrun-merge-report") or die("FAILED to open dryrun merge report: $!"); my @lines = <FH>; close(FH); my $message = <<'__MESSAGE__'; From: kkurnala@wsgc.com To: kkurnala@wsgc.com,wso@wsgc.com,SJStephens@wsgc.com Subject: Daily Dry-Run Merge Report - Test Message __MESSAGE__ $message .= join('',@lines); my $sender = Email::Send->new({mailer => 'Sendmail'}); my $result = $sender->send($message); print "$result\n";
In reply to Re: Read a log file's content and send it in body of email
by tangent
in thread Read a log file's content and send it in body of email
by kkurnala
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |