I would rather not have to create a temporary html file to do this#!/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 "<HTML>\n"; print DAT "<BODY>\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</BODY>\n"; print DAT "\n</HTML>"; close(DAT); my $msg = MIME::Lite->new(From => 'noname@nohost', To => 'someone@nowhere.com', Subject => 'Report', Type => 'text/html', Path => 'test.html'); $msg->send;
In reply to HTML file or in-memory ? by Anonymous Monk
| For: | Use: | ||
| & | & | ||
| < | < | ||
| > | > | ||
| [ | [ | ||
| ] | ] |