How to Email Attachments in Perl
Below as a small snipped that can be used to email attachments
sub Mail { # Handles attachments # my($from, $to, $subject, $body, @attachments) = @_; my $cmd = '/util/sendEmail'; foreach $attachment (@ARGV) { $cmd .= qq# -a "$attachment"# if -r "$attachment"; } $cmd .= qq# -u "$subject"# if $subject; $cmd .= qq# -f "$from"# if $from; $cmd .= qq# -t "$to"# if $to; $cmd .= $body ? qq# -m "$body"# : '</dev/null'; $out = `$cmd`; return "SUCCESS: Mail sent to $to" if $out =~ /Email sent successfully/; return "ERROR: sendEmail failure - $out"; }