kkurnala has asked for the wisdom of the Perl Monks concerning the following question:
I am only getting a blank line like ---------- in the body of e-mail currently. The log file contains text like:#!/usr/bin/perl -w use strict; use warnings; use Email::MIME::CreateHTML; use Email::Send; my $plain_text='text/plain'; my $sampletext; open(FH, "</apps/dryrun-merges/logs/dryrun-merge-report") || die("FAIL +ED to open dryrun merge report: $!"); #while(<FH>){ #$sampletext = $_; #} #close (FH); my $email = Email::MIME->create_html( header => [ From => 'kkurnala@wsgc.com', To => 'kkurnala@wsgc.com #,wso@wsgc.com,SJStep +hens@wsgc.com', Subject => 'Daily Dry-Run Merge Report - Test +Message', ], body => @lines, text_body => $plain_text ); my $sender = Email::Send->new({mailer => 'Sendmail'}); #$Email::sendmail = '/usr/sbin/sendmail'; #$sender->send($message) or die "Unable to send E-mail\n"; # $sender->mailer_args([Host => 'smtp.example.com']); $sender->send($email); print "About to send the E-mail, good-Bye!\n"; exit 0;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Read a log file's content and send it in body of email
by tangent (Parson) on Mar 26, 2012 at 22:58 UTC | |
by kkurnala (Initiate) on Mar 27, 2012 at 02:38 UTC |