sub Notify { local $Message = $_[0]; &MailMessage(${MailList},"***${JobName}: ${Host}: ${Message} ${LogFile}",${LogFile},${Host} ); }; sub MailMessage { # This file will send mail to the recipient with the given subject. # If the body is supplied, it will also be sent. If a sender is # supplied, the message will be marked with that sender in the "From" # field. local $Recipient = $_[0]; local $Subject = $_[1]; local $Body = $_[2]; local $Sender = $_[3]; $Recipient =~ s/\n+//; $Subject =~ s/\n+//; $Sender =~ s/\n+//; if (!defined $MailFile) { if ($OSFlag ne "Y") { &DefineOS; }; $MailFile = "${Temp}/mis_mail.$$"; }; if (-r $Body) { open (MAILFILE, "> $MailFile"); open (BODY, "$Body"); while (
) { print MAILFILE "$_"; }; close (BODY); close (MAILFILE); } else { open (MAILFILE, "> $MailFile"); print MAILFILE "$Body"; close (MAILFILE); }; if ($OS eq "MSWin32") { $Mail = qq! $Mail $MailFile -t "$Recipient" -s "$Subject" ! . qq! -i "$Sender" -f "$Sender" !; print "using blat...\n"; open (MAIL, "| $Mail"); while (