PerlSufi has asked for the wisdom of the Perl Monks concerning the following question:
use MIME::Entity; my $file = "$ARGV[0]"; open (my $fh, '<', $file) or die "Could not open file: $!"; my $out = "fixed_"."$ARGV[0]"; open (my $fhout, '>', $out) or die "Could not open file: $!"; while (<$fh>) { file handling stuff here... } close($fh); close($fhout); my $report = MIME::Entity->build(Type=>"multipart/mixed", From=> "me\@awesome.com", To=> "me\@awesome.com", Subject=> "Formatted Report- "."$ARGV[0]"); $report->attach( Type=>'text/plain', Encoding=> 'base64', Path=> "$ENV{HOME}", Filename=> "fixed_"."$ARGV[0]" ); open MAIL, "|/usr/sbin/sendmail -t"; $report->print(\*MAIL); close MAIL;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Email Text File
by runrig (Abbot) on Jun 28, 2013 at 17:46 UTC | |
by PerlSufi (Friar) on Jun 28, 2013 at 18:12 UTC | |
by PerlSufi (Friar) on Jun 28, 2013 at 20:44 UTC | |
by runrig (Abbot) on Jun 28, 2013 at 21:01 UTC | |
|
Re: Email Text File
by marto (Cardinal) on Jun 28, 2013 at 17:34 UTC | |
by runrig (Abbot) on Jun 28, 2013 at 17:59 UTC |