Mail::Sendmail with attachments and embed Perl in Bash script
- by beicha
1 I want to embed below Perl script in BASH script, and the Message should read from a message.txt file. How to realize this?
use Mail::Sendmail;
%mail = ( To => '[email protected]',
From => '[email protected]',
Message => "This is a very short message"
);
sendmail(%mail) or die $Mail::Sendmail::error;
print "OK. Log says:\n", $Mail::Sendmail::log;
2 How to attach log files via Perl script?