Beefy Boxes and Bandwidth Generously Provided by pair Networks
Keep It Simple, Stupid

Re: MIME Lite HTML with Attachments

by benn (Vicar)
on Sep 06, 2003 at 10:36 UTC ( #289446=note: print w/replies, xml ) Need Help??

in reply to MIME Lite HTML with Attachments

The docs for MIME::Lite::HTML don't make this clear at all, and I had to look at the source to suss what was going on...

M::L::H *doesn't* inherit from MIME::Lite - it just uses it....but the good news is that it returns a MIME::Lite object when you call the parse method, so what you actually want is this...

my $mailHTML = new MIME::Lite::HTML From => '', # etc. ; my $MIMEmail = $mailHTML->parse(''); $MIMEmail->attach( Type =>'text/html; etc. etc); $MIMEmail->send_by_smtp('');

Replies are listed 'Best First'.
Re: Re: MIME Lite HTML with Attachments
by knexus (Hermit) on Sep 06, 2003 at 11:18 UTC
    Thanks benn, you just beat me to it. ;-)

    After getting some sleep, I started looking at the package source and it became clear that M::L::H contians a M::L and does NOT inherit from it.

    However, parse() returns a M::L for the caller to use for sending the email. That's when it HIT ME (doh!). I should have realized what was going on by how the send() was done, ie. via $MIMEmail and not $mailHTML.
    So, things are much better now... perhaps it was the sleep? ;-}

    Anyhow, that's just another one to add to the lessons learned list.
    Plus being new to perl, it's nice get confirmation from someone else, so many thanks for the reply.

Log In?

What's my password?
Create A New User
Node Status?
node history
Node Type: note [id://289446]
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others studying the Monastery: (4)
As of 2021-01-28 05:47 GMT
Find Nodes?
    Voting Booth?