Beefy Boxes and Bandwidth Generously Provided by pair Networks
Problems? Is your data what you think it is?
 
PerlMonks  

Re: MIME Lite HTML with Attachments

by benn (Priest)
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 => '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.


Comment on Re: MIME Lite HTML with Attachments
Select or Download Code
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
Node Status?
node history
Node Type: note [id://289446]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this? | Other CB clients
Other Users?
Others examining the Monastery: (7)
As of 2014-08-30 21:55 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    The best computer themed movie is:











    Results (294 votes), past polls