[oak perl] MIME::Lite question (solved)

M. Lewis cajun at cajuninc.com
Thu Jun 2 20:20:45 PDT 2005


Per the original posting, I was not able to get MIME::Lite to include 
the images in the HTML file. Not sure why this was. While searching 
Google, I learned there was a module MIME::Lite::HTML which is 
apparently made for almost just what I'm trying to accomplish.

As I said in a previous posting, I initially tried the following code 
bits I was not able to get to work:

my $msg = new MIME::Lite::HTML
 From     => "$from",
To       => "$recipient",
Subject  => "$subject";

$msg = $msg->parse("$content");
$msg->send;

In the documentation I was not able to find a way to use a $variable 
such as $content. It occured to me to plop the html on my server. The 
example in the docs was very clear about that:

my $msg = new MIME::Lite::HTML
 From     => "$from",
To       => "$recipient",
Subject  => "$subject";

$msg = $msg->parse('http://localhost/somehtmlfile.html');
$msg->send;

This works fine. Well nearly. After finally figuring this out, I was 
again reminded that all mailers are not alike. In looking at the html 
page with Firefox, everything was fine, both the English and the Spanish 
versions. But when I mailed it and read it with Thunderbird, the 
accented Spanish characters do not come out right. If I mail the same 
file to a yahoo account, everything is fine.

Right about now, I'm so sick of HTML.... I believe I'll have a beer.

Thanks again to all for the suggestions / comments.

Mike



M. Lewis wrote:
> I'm trying to use MIME::Lite to send out a mailing. The mailing is an 
> HTML document ($content) with two images in it.
> 
> The message is being sent as HTML, however the two images do not appear. 
>   I've tried adding other attachments for the two images, but that just 
> makes them appear as attachments (duh..) rather than in the HTML document.
> 
> Obviously I have missed the boat here somewhere. Suggestions welcome.
> 
> Thanks,
> Mike
> 
> 
> $msg = MIME::Lite->new(
>      From     => "$from",
>      To       => "$recipient",
>      Subject  => "$subject",
>      Date     => `date`,
>      Type     => 'multipart/related',
> );
> 
> $msg->attach(Type => 'text/html',
> Path => "$content");
> 

-- 

  IBM: Itty Bitty Machines
  22:11:01 up 8 days,  4:28,  7 users,  load average: 0.08, 0.06, 0.01

  Linux Registered User #241685  http://counter.li.org


More information about the Oakland mailing list