in reply to How do I send ONLY HTML mail using MIME::Lite::TT::HTML
#!/usr/bin/perl use strict; use warnings; use MIME::Lite::TT::HTML; my %params; $params{firstname} = 'MyFirstName'; $params{lastname} = 'MyLastName'; my %options; $options{INCLUDE_PATH} = '/path/to/template'; my $msg = MIME::Lite::TT::HTML->new( From => 'email@domain.com', To => 'otheremail@otherdomain.com', Subject => 'Test 1', Timezone => 'UTC', Type => 'multipart/related', Encoding => 'base64', Template => { html => 'template.html', }, Charset => 'utf8', TmplOptions => \%options, TmplParams => \%params, ); $msg->attach( Type => 'text/html', Data => qq{ <body> Here is <i>my</i> image: <img src="cid:image.png"> </body> }, ); $msg->attach( Type => 'image/png', Path => '/path/to/image/image.png', Id => 'img1', ); $msg->send( 'smtp', 'smtp.somedomain.com', Debug => 1, Timeout => 60, );
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re^2: How do I send ONLY HTML mail using MIME::Lite::TT::HTML
by trebor (Initiate) on Mar 07, 2012 at 16:35 UTC |