SPUG: CPAN Mail::Mailer ...help!

David Vergin dvergin at igc.org
Thu May 4 13:01:17 CDT 2000


That is indeed what appears on that page. I do not use Mail::Mailer;
preferring the direct approach that follows that example in the book.

But at the very least you will need to specify the contents of $email,
$mailto, and $subject. Although sometimes I wonder, in fact, Perl cannot
read your mind. <grin>

See below for sample insertion.

Note that if you use double quotes at some point for email addresses you
have to escape the @ thus:

      "Shamon22\@aol.com"

Regards,
david

> ******************************************************
>
> #!/usr/bin/perl
>
> # cgi-bin/contact.cgi:Information sending program.
> # TESTING --Contact.html(v2)
>
> use Mail::Mailer;

$email   = 'Shamon22 at aol.com';
$mailto  = 'someone at somewhere.com';              # insert desired recipient
here
$subject = 'This is the subject line';           # insert your subject here
$body    = 'A whole bunch of text that might'    # your message here
         . ' go on and on for several lines.';

> $mailer = Mail::Mailer->new("sendmail");
> $mailer->open({ From    => $email,
>                 To      => $mailto,
>                 Subject => $subject,
>                 })
>         or die "Can't open: $!\n";
> print $mailer $body;
> $mailer->close();
>


 - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
     POST TO: spug-list at pm.org       PROBLEMS: owner-spug-list at pm.org
 Seattle Perl Users Group (SPUG) Home Page: http://www.halcyon.com/spug/
 SUBSCRIBE/UNSUBSCRIBE: Replace "action" below by subscribe or unsubscribe
           Email to majordomo at pm.org: "action" spug-list your_address





More information about the spug-list mailing list