TStanley has asked for the wisdom of the Perl Monks concerning the following question:
if($#ARGV==-1) { #use current date $date='date--d'1 day ago'+'%Y-%m-%d''; chop($date); } else { print"USAGE: summary.pl[date yyyy-mm-dd]\n"; } $rptname="summary".$date.".txt"; print"Date: ",$date,"\n"; print"Report: ",$rptname,"\n"; open(RPT,">$rptname")||warn "Unable to open report file: $!\n";
use MIME::Lite; $msg=MIME::Lite->new( From =>'root@localhost.mycompany.com', To =>'myname@mycompany.com', Subject =>'Summary Report', Type =>'multipart/mixed'); $msg->attach(Type =>'TEXT', Data =>"Summary Report for yesterday"); $msg->attach(Type =>'TEXT', Path =>'$rptname', Filename =>'summary'.$date.'.txt'); $msg->send;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
RE: MIME::Lite
by young perlhopper (Scribe) on Jul 24, 2000 at 22:18 UTC | |
by TStanley (Canon) on Jul 24, 2000 at 22:31 UTC | |
by splinky (Hermit) on Jul 25, 2000 at 03:20 UTC | |
|
Re: MIME::Lite
by le (Friar) on Jul 24, 2000 at 23:19 UTC | |
by fundflow (Chaplain) on Jul 24, 2000 at 23:46 UTC | |
|
Re: MIME::Lite
by redmist (Deacon) on Jul 24, 2000 at 23:44 UTC |