MIME::Lite::HT::HTML - Create HTML mail with MIME::Lite and HTML::Template
use MIME::Lite::HT::HTML; my $msg = MIME::Lite::HT::HTML->new( From => 'from@example.com', To => 'to@example.com', Subject => 'Subject', TimeZone => 'Europe/Berlin', Encoding => 'quoted-printable', Template => { html => 'mail.html', text => 'mail.txt', }, Charset => 'utf8', TmplOptions => \%options, TmplParams => \%params, ); $msg->send;
This module provide easy interface to make MIME::Lite object with HTML formatted mail.
return MIME::Lite object with HTML mail format.
This is a mapping of filenames to the two variants of templates (HTML or text). You define, which file will be used for the HTML-part and the plain/text part.
The filenames will be passed to the constructor of HTML::Template, as argument of the filename option. See HTML::Template for more information.
The parameters of a template are set to these options. This parameter must be the reference of hash.
Configuration of HTML::Template is set to this option (e.g. die_on_bad_params or path).
You can specify the time zone of the mail date:
TimeZone => 'Asia/Shanghai',
default using 'UTC' if not defined.
Mail body will be encoded for transfer.
Use encoding: | If your message contains: ------------------------------------------------------------ 7bit | Only 7-bit text, all lines <1000 characters 8bit | 8-bit text, all lines <1000 characters quoted-printable | 8-bit text or long lines (more reliable than "8bit") base64 | Largely non-textual data: a GIF, a tar file, etc.
default using '7bit' if not defined.
You can specify the charset of your mail, both subject and body will using the charset to make mail reader's client satisfied.
Charset => 'big5',
And, if you are giving the original words as UTF8 and attempt to mail them as GB2312 charset, you can define the charset like:
Charset => [ 'utf8' => 'gb2312' ],
We will using Encode to make this happy.
Alexander Becker <asb@cpan.org> But all I did was c&p from MIME::Lite::TT::HTML
HTML::Template, MIME::Lite, MIME::Lite::TT, MIME::Lite::TT::HTML
This library is free software, you can redistribute it and/or modify it under the same terms as Perl itself.
To install MIME::Lite::HT::HTML, copy and paste the appropriate command in to your terminal.
cpanm
cpanm MIME::Lite::HT::HTML
CPAN shell
perl -MCPAN -e shell install MIME::Lite::HT::HTML
For more information on module installation, please visit the detailed CPAN module installation guide.