knexus has asked for the wisdom of the Perl Monks concerning the following question:
I am trying to use the MIME::Lite::HTML package to email web pages and include e-mail attachments. I have no problems using MIME::Lite to send mail with attachments and no problem using MIME::Lite::HTML to send a web page.
I figured that MIME::Lite::HTML inherits from MIME::Lite so I thought I'd be able to use MIME Lite methods to add the attachments... but apparently I do not understand the mechanism well enough. Sorry if this is a dumb mistake, it's just been a long "short" week. ;-(
Most of the code is straight from the Module's DOCs.
Could someone tell me if what I want to do is "do-able" and if so what's wrong with the code.
Thanks
The Errors
Name "mailHTML::MIME::Lite" used only once; possible typo at mailhtml. +pl line 15. Can't call method "attach" on an undefined value at mailhtml.pl line 1 +5.
The Code
#!/usr/bin/perl -w use strict; use MIME::Lite; use MIME::Lite::HTML; my $mailHTML = new MIME::Lite::HTML From => 'Someone@anyplace.com', To => 'someoneelse@theirplace.com', Subject => 'Search here if you want!', 'X-Priority'=> 1, 'X-MSMail-Priority' => 'High', ; $mailHTML::MIME::Lite->attach( Type =>'text/html; charset="iso-8859-1" +', Data => '<b>Brought to you now!</b>', ); my $URL = 'http://google.com'; my $MIMEmail = $mailHTML->parse("$URL"); $MIMEmail->send_by_smtp('smtp-server.cfl.rr.com');
|
|---|
| Replies are listed 'Best First'. | |
|---|---|
|
Re: MIME Lite HTML with Attachments
by snax (Hermit) on Sep 05, 2003 at 23:22 UTC | |
by knexus (Hermit) on Sep 06, 2003 at 00:15 UTC | |
|
Re: MIME Lite HTML with Attachments
by benn (Vicar) on Sep 06, 2003 at 10:36 UTC | |
by knexus (Hermit) on Sep 06, 2003 at 11:18 UTC |