Ask a Question related to PERL Beginners, Design and Development.
-
Paul Harwood #1
HTML reports via email
I am trying to learn the best way to send HTML formatted reports via
e-mail using the standard modules that come with Perl 5.8. The examples
I have seen assign blocks of HTML code to scalars and pass them to the
NET::SMTP datasend() method etc. I was wondering if there was a better,
more efficient way of doing this (maybe using filehandles?). The FORMAT
command works ok for screen output but I wanted to have things look
fancier when I send the report via email.
--Paul
Paul Harwood Guest
-
how i can do form email by html ??
hello I want code to make a page same as the one below ... Thanks http://zebu.uoregon.edu/cgi-bin2/mailform2?dmason@zebu.uoregon.edu -
HTML email newsletters
well i dont know how many people use Contribute to do newsletters, but as long as they are web pages on your server and contribute can access your... -
HTML email newsletters
well i dont know how many people use Contribute to do newsletters, but as long as they are web pages on your server and contribute can access your... -
HTML email newsletters
Hi -- I have this same question. I would also like to know if there are any user examples of newsletters made with Contribute. This would help me... -
html page to email
What is the proper way to design an html page to be emailed? How do I place it in the email? I have tried a few ways and the most successful does... -
Randal L. Schwartz #2
Re: HTML reports via email
>>>>> "Paul" == Paul Harwood <harwood@nyclimits.org> writes:
Paul> I am trying to learn the best way to send HTML formatted reports via
Paul> e-mail using the standard modules that come with Perl 5.8. The examples
Paul> I have seen assign blocks of HTML code to scalars and pass them to the
Paul> NET::SMTP datasend() method etc. I was wondering if there was a better,
Paul> more efficient way of doing this (maybe using filehandles?). The FORMAT
Paul> command works ok for screen output but I wanted to have things look
Paul> fancier when I send the report via email.
I presume this is only for people who had explicitly signed up to
get HTML reports. I reject HTML email, reading only the text fork,
and I know many others who do likewise.
HTML is for the web, not for email.
--
Randal L. Schwartz - Stonehenge Consulting Services, Inc. - +1 503 777 0095
<merlyn@stonehenge.com> <URL:http://www.stonehenge.com/merlyn/>
Perl/Unix/security consulting, Technical writing, Comedy, etc. etc.
See PerlTraining.Stonehenge.com for onsite and open-enrollment Perl training!
Randal L. Schwartz Guest
-
Daniel Staal #3
Re: HTML reports via email
--As off Sunday, January 25, 2004 5:30 PM -0800, Paul Harwood is
alleged to have said:
--As for the rest, it is mine.> I am trying to learn the best way to send HTML formatted reports via
> e-mail using the standard modules that come with Perl 5.8. The
> examples I have seen assign blocks of HTML code to scalars and
> pass them to the NET::SMTP datasend() method etc. I was wondering
> if there was a better, more efficient way of doing this (maybe
> using filehandles?). The FORMAT command works ok for screen output
> but I wanted to have things look fancier when I send the report via
> email.
>
> --Paul
I'd probably use Mail::Sender, it can handle multipart email quite
easily, either from a file or from a scalar. (And in 5.8 you can use
a scalar as a file.)
The 'multipart' part of it of course means that you can send both a
HTML part and a plain text part...
Daniel T. Staal
---------------------------------------------------------------
This email copyright the author. Unless otherwise noted, you
are expressly allowed to retransmit, quote, or otherwise use
the contents for non-commercial purposes. This copyright will
expire 5 years after the author's death, or in 30 years,
whichever is longer, unless such a period is in excess of
local copyright law.
---------------------------------------------------------------
Daniel Staal Guest
-
Jenda Krynicky #4
Re: HTML reports via email
From: "Paul Harwood" <harwood@nyclimits.org>
What filehandles? Do you think you want a filehandle opened to the> I am trying to learn the best way to send HTML formatted reports via
> e-mail using the standard modules that come with Perl 5.8. The
> examples I have seen assign blocks of HTML code to scalars and pass
> them to the NET::SMTP datasend() method etc. I was wondering if there
> was a better, more efficient way of doing this (maybe using
> filehandles?). The FORMAT command works ok for screen output but I
> wanted to have things look fancier when I send the report via email.
>
> --Paul
SMTP server so that you could print to it directly?
You don't want to do that! While it may seem to work fine on your
current server during testing I assure you it will break later or on
other servers. (Eg. some SMTP servers are very picky about newlines!
And did you make sure you double all dots on the beginning of lines?)
Net::SMTP is as low-level as you should get.
And actually I believe you should not go this low. It'd be better to
use MIME::Lite or Mail::Sender to take care of headers, attachments
and encodings.
Jenda
===== [email]Jenda@Krynicky.cz[/email] === [url]http://Jenda.Krynicky.cz[/url] =====
When it comes to wine, women and song, wizards are allowed
to get drunk and croon as much as they like.
-- Terry Pratchett in Sourcery
Jenda Krynicky Guest



Reply With Quote

