HTML reports via email

Ask a Question related to PERL Beginners, Design and Development.

  1. #1

    Default 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

  2. Similar Questions and Discussions

    1. 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
    2. 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...
    3. 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...
    4. 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...
    5. 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...
  3. #2

    Default 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

  4. #3

    Default Re: HTML reports via email

    --As off Sunday, January 25, 2004 5:30 PM -0800, Paul Harwood is
    alleged to have said:
    > 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
    --As for the rest, it is mine.

    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

  5. #4

    Default Re: HTML reports via email

    From: "Paul Harwood" <harwood@nyclimits.org>
    > 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
    What filehandles? Do you think you want a filehandle opened to the
    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

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139