RTFM stands for "Read The Fine Manual". Some people prefer an expletive for the third word ... but the point is that you should have read the docs for Mail::Mailer:
ARGUMENTS

"new" can optionally be given a $command and $type.  $type
is one "sendmail", "mail", ... given above.  The meaning
of $command depends on $type.

"open" is given a reference to a hash.  The hash consists
of key and value pairs, the key being the name of the
header field (eg, "To"), and the value being the
corresponding contents of the header field.  The value can
either be a scalar (eg, "gnat@frii.com") or a reference to
an array of scalars ("eg, ['gnat@frii.com',
'Tim.Bunce@ig.co.uk']").
So ... here is how i would write your code snippet:
use Mail::Mailer; my @param = qw( Title Name Position School Address Suburb State PCode Email Tel Fax Att1 Att2 Att3 Att4 Att5 Att6 Att7 Att8 Att9 Comments ); my $mailer = Mail::Mailer->new; $mailer->open({ To => 'foo@bar.com', From => 'baz@qux.com', Subject => 'results of submit', }); my $body; $body .= "$in{$_}\n" for @param; print $mailer $body; $mailer->close;
Hope this helps. :)

jeffa

L-LL-L--L-LL-L--L-LL-L--
-R--R-RR-R--R-RR-R--R-RR
B--B--B--B--B--B--B--B--
H---H---H---H---H---H---
(the triplet paradiddle with high-hat)

In reply to 3Re: How do I send mail from a script? by jeffa
in thread How do I send mail from a script? by Nickd_69

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.