in reply to Sending HTML-formatted email
You may want to use a template
#!/usr/bin/perl use strict; use warnings; use MIME::Lite; use HTML::Template; #by jeffa of perlmonks my $t = HTML::Template->new( filehandle => \*DATA ); $t->param( field => 'foo', data => 'bar', ); my $msg = MIME::Lite->new( From => 'me@myhost.com', To => 'you@yourhost.com', Subject => 'Hello HTML', Data => $t->output, # you can just use $myInfo here i +nstead Type => 'text/html', ); $msg->send; __DATA__ <html> <body> <h1>Hello HTML!</h1> <table> <tr> <td><tmpl_var field></td> <td><tmpl_var data></td> </tr> </table> </body> </html>
|
|---|