Mail::Sendmail with attachments and embed Perl in Bash script

Posted by beicha on Server Fault See other posts from Server Fault or by beicha
Published on 2012-03-28T08:15:07Z Indexed on 2012/03/28 11:31 UTC
Read the original article Hit count: 328

Filed under:

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?

© Server Fault or respective owner

Related posts about bash