Beefy Boxes and Bandwidth Generously Provided by pair Networks
Don't ask to ask, just ask
 
PerlMonks  

Re: MIME Lite HTML with Attachments

by benn (Vicar)
on Sep 06, 2003 at 10:36 UTC ( [id://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 => 'Someone@anyplace.com', # etc. ; my $MIMEmail = $mailHTML->parse('http://google.com'); $MIMEmail->attach( Type =>'text/html; etc. etc); $MIMEmail->send_by_smtp('smtp-server.cfl.rr.com');
Cheers,
Ben.

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?
Username:
Password:

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

How do I use this?Last hourOther CB clients
Other Users?
Others chilling in the Monastery: (3)
As of 2025-02-08 22:39 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?
    Which URL do you most often use to access this site?












    Results (95 votes). Check out past polls.