sravs448 has asked for the wisdom of the Perl Monks concerning the following question:
use HTML::Entities; use Mail::Sendmail; use MIME::Lite; use Term::ANSIColor; use Time::localtime; use HTML::Mason; my $ti = localtime; my ($day,$month,$year)=($ti->mday,$ti->fullmonth,$ti->year); # DEFINE A HASH %coins = ( "Quarter" , 25, "Dime" , 10, "Nickel", 5 ); $html = <<END_HTML; <table border='1'> <th>Keys</th><th>Values</th> <%perl> while (($key, $value) = each(%coins)){ </%perl> <tr><td>$key</td>; <td>$value</td></tr>; <%perl> } </%perl> </table>; END_HTML $msg = MIME::Lite->new( from => 'abc@mydomain.com', To =>'def@mydomain.com', Subject =>'Report', Type =>'multipart/related' ); $msg->attach( Type => 'text/html', Data => qq{ <body> <html>$html</html> </body> }, ); $msg->attach( Type => 'image/gif', Id => 'banner.jpg', Path => 'C:\Users\Pictures\banner.jpg', ); MIME::Lite -> send ('smtp','xxxs.xxxx.xxxxx.com' ); $msg -> send;
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: perl : Print a perl hash inside HTML tags in a tabular format
by kennethk (Abbot) on Sep 19, 2014 at 17:17 UTC | |
|
Re: perl : Print a perl hash inside HTML tags in a tabular format
by choroba (Cardinal) on Sep 19, 2014 at 16:11 UTC | |
by sravs448 (Acolyte) on Sep 19, 2014 at 16:14 UTC | |
|
Re: perl : Print a perl hash inside HTML tags in a tabular format
by zentara (Cardinal) on Sep 19, 2014 at 16:07 UTC | |
by sravs448 (Acolyte) on Sep 19, 2014 at 16:12 UTC |