ADMMailHandler.pm
use ADMMailHandler;
ADMLogger is an object-oriented extendable framework for log analysis tools. Many system administrators have a handful of tools that they like to run on their logs daily/weekly/at rotation, etc. ADMLogger attempts to bring them all together by providing a set of common tools for all perl scripts to to maintain a consistency across all programs. It also allows the admin to only run a single program, and for them to focus on the coding of the core of what they need to do - allowing ADMLogger to provide all I/O support, etc.
Typical lifecycle of an ADMMailHandler object: Contruction Subject Building Sending (Destruction)
None known.
Aaron D. Marasco (Aaron@Marascos.net)
new subject append checkflag clearflag isHTML setHTML isSendable sendit
Usage:
new($to, $html, $subject);
Parameters:
$to - e-mail address message will be sent to $html - flag to send HTML MIME Type or not $subject - subject of email (optional) can be changed - see subject()
Returns:
Reference to a ready ADMMailHandler.
Usage:
subject($subject);
Parameters:
$subject - subject of email
Returns:
string - Empty if success, else error message.
append($string);
Parameters:
$string - a single string to add
Returns:
string - Empty if success, else error message (none defined).
Usage:
checkflag();
Parameters:
none
Returns:
1 if data has changed, 0 if not.
Usage:
clearflag();
Parameters:
none
Returns:
1 always.
Usage:
isHTML();
Parameters:
none
Returns:
1 if HTML enabled, 0 if not.
Usage:
setHTML($flag);
Parameters:
$flag - 1 if HTML enabled, 0 if not.
Returns:
0 if $flag is invalid, otherwise 1.
Usage:
isSendable();
Parameters:
none
Returns:
1 if sendit should succeed, 0 if not.
sendit($mailer);
Parameters:
$mailer - mail executable to use (optional) defaults to "/usr/sbin/sendmail -t"
Returns:
string - Empty if success, else error message.