$TYPE = "\U$ARGV[0]";

$SERVER_USER     = $ENV{SERVER_USER}; 
$SERVER_HOSTNAME = $ENV{SERVER_HOSTNAME}; 
$SERVER_HOME     = $ENV{SERVER_HOME};
$SERVER_EMAIL    = $ENV{SERVER_EMAIL};
$SERVER_NAME     = $ENV{SERVER_NAME};
$SERVER_COMMENTS = $ENV{SERVER_COMMENTS};
$BASE_HREF       = $ENV{SERVER_WWW_URL};
$BACKGROUND      = $ENV{BACKGROUND};

chop($TITLE = `cat $ENV{SERVER_SOLVERS}/$TYPE/TITLE`);
$TEMPLATE = `cat $ENV{SERVER_LIB}/html/solver-email.html`;
$TEMPLATE =~ s/<SERVER_NAME>/$SERVER_NAME/g;
$TEMPLATE =~ s/<SERVER_COMMENTS>/$SERVER_COMMENTS/g;
$TEMPLATE =~ s/<SERVER_EMAIL>/$SERVER_EMAIL/g;
$TEMPLATE =~ s/<SERVER_USER>/$SERVER_USER/g;
$TEMPLATE =~ s/<SERVER_HOSTNAME>/$SERVER_HOSTNAME/g;
$TEMPLATE =~ s/<SOFTWARE_TITLE>/$TITLE/g;
$TEMPLATE =~ s/<SOFTWARE_TYPE>/$TYPE/g;
$TEMPLATE =~ s/<BASE_HREF>/$BASE_HREF\//g;
$TEMPLATE =~ s/BGCOLOR/$BACKGROUND/;
print $TEMPLATE; 
