sreekanth.adari has asked for the wisdom of the Perl Monks concerning the following question:
1. Run A command 2. Send output of the command to my email Below is the Script : #!C:/Perl/bin/perl.exe use Mail::Sendmail; my $to_list = 'sadari@travco.co.uk'; my $email = "\n\nThis email was generated automatically.\n"; my $MailFrom = "storageadmalerts\@travco.co.uk"; my $subject = "Storage Array pool Status"; my $cmd = qx(raidcom get pool); my $message = "$cmd"; %mail = ( To => $to_list, From => $MailFrom, Bcc => $bcc_list, Cc => $cc_list, Subject => $subject, Message => $message ); $mail{Smtp} = 'mailtest.gmail.com'; sendmail(%mail)
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: Script Failing to Run through Task Scheduler in Windows
by i5513 (Pilgrim) on Feb 05, 2015 at 11:06 UTC | |
by sreekanth.adari (Initiate) on Feb 05, 2015 at 11:37 UTC | |
by i5513 (Pilgrim) on Feb 05, 2015 at 12:05 UTC | |
by sreekanth.adari (Initiate) on Feb 06, 2015 at 09:59 UTC | |
by i5513 (Pilgrim) on Feb 06, 2015 at 12:02 UTC |