in reply to printing output of a perl script to the Email body
The easiest approach is to wrap the script in a second script that runs the first one in (say) backticks and then sends the output via MIME::Lite.
use MIME::Lite; my $output = `other_script.pl 2>&1`; $msg = MIME::Lite->new( From => 'me@myhost.com', To => 'you@yourhost.com', Cc => 'some@other.com, some@more.com', Subject => 'Output of a script...', Type => 'multipart/mixed' ); ### Add parts (each "attach" has same arguments as "new"): $msg->attach( Type => 'TEXT', Data => $output );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: printing output of a perl script to the Email body
by Bod (Parson) on Jan 29, 2021 at 10:59 UTC | |
by Corion (Patriarch) on Jan 29, 2021 at 11:04 UTC | |
by Bod (Parson) on Jan 29, 2021 at 23:17 UTC | |
by haukex (Archbishop) on Jan 29, 2021 at 18:34 UTC | |
by hippo (Archbishop) on Jan 29, 2021 at 12:04 UTC |