#!/usr/bin/perl -w #===================================================================== # # PROGRAM: mime_tester.pl # # PURPOSE: This program sends SMARTS monitoring data (as HTML link) # to email addresses. # # AUTHOR: Ron Bueler # # DATE: April 22, 2001 # # # Revision History: # # #===================================================================== # Use various Perl modules #--------------------------------------------------------------------- use strict; use diagnostics; use MIME::Entity; #===================================================================== # Flush STDOUT (i.e.; don't use buffered I/O) #--------------------------------------------------------------------- select (STDOUT); $| = 0; #===================================================================== # Define some variables #--------------------------------------------------------------------- my ($msg) = ""; my ($message) = ""; my ($plain) = ""; my ($fancy) = ""; #===================================================================== # Start of mime_tester.pl #--------------------------------------------------------------------- { &log ("Starting program $0\n"); &log ("1. Create the email, and set up the mail headers...\n"); $msg = MIME::Entity->build ( From => "smart\@pm02rg.rst.cw.net", To => "buelerra\@codenet.net", Subject => "SMART CPU Utilization Report", Type => "multipart/alternative" ); &log ("2. Create the HTML headers...\n"); $fancy = $msg->attach(Type => 'multipart/related'); &log ("3. Insert the HTML code...\n"); $fancy->attach(Type => 'text/html', Data => [qq<