#!/usr/bin/perl use DBI; use DBIx::XHTML_Table; use MIME::Lite 1.137; $user="sybuser"; $server=SERVER; $pass=nopass; open(DAT,">test.html"); print DAT "\n"; print DAT "
\n"; my $dbh = DBI->connect("dbi:Sybase:server=$server", $user, $pass,{ PrintError => 0, # Don't print warning messages RaiseError => 1 } ); my $table = DBIx::XHTML_Table->new($dbh); $table->exec_query(" select srvname from master..sysservers where srvid=0 "); $table->modify(td => { style => 'color: black; background: yellow; text-align: center; border: 1', }); print DAT $table->output({ no_head => 1 }); $table->exec_query(" select SPID,Login,Application,DBName from monProcess where Login not in (NULL,'probe') "); $table->modify(table => { border => 2, width => '100%', }); $table->modify(th => { style => 'color: black; text-align: center; font-weight: bold', }); $table->modify(td => { style => 'color: black; background: yellow; text-align: center; border: none', }); print DAT $table->output({ no_head => 0 }); $dbh->disconnect; print DAT $table->output({ no_head => 0 }); print DAT "\n\n"; print DAT "\n"; close(DAT); my $msg = MIME::Lite->new(From => 'noname@nohost', To => 'someone@nowhere.com', Subject => 'Report', Type => 'text/html', Path => 'test.html'); $msg->send;