The Perl Toolchain Summit needs more sponsors. If your company depends on Perl, please support this very important event.

NAME

Net::Peep::Mail - Utility object for e-mail notifications

SYNOPSIS

  use Net::Peep::Mail;
  $mail = new Net::Peep::Mail;
  $mail->smtp_server(@servers);
  $mail->timeout(15); # seconds.  (Optional)
  $mail->to(@to);
  $mail->from($from);
  $mail->subject($subject);
  $mail->body($body);
  $mail->send();

DESCRIPTION

Utility object for e-mail notifications. It is primarily a wrapper for the Net::SMTP object.

Loops through SMTP servers and e-mail addresses until mail has been successfully sent to all recipients or the SMTP server list is exhausted and logs any failures.

EXPORT

None by default.

ATTRIBUTES

    $LOGGER - A Net::Peep::Log object.

METHODS

    new() - The constructor

    to($to0,[$to1,...]) - Get/set method.  The recipient of the
    e-mail.  Must be a valid e-mail address.  Can be a list.

    from([$from]) - Get/set method.  The sender of the e-mail.  Must
    be a valid e-mail address.

    smtp_server([$smtp_server]) - Get/set method.  The SMTP server
    through which e-mails will be routed.  May be a list, in which
    case each server will be tried until delivery is successful.

    timeout([$timeout]) - Get/set method.  Controls the number of
    seconds before timeout.  Must be an integer.  Default 15.

    subject([$subject]) - Get/set method.  The e-mail subject.

    body([$body]) - Get/set method.  The body of the e-mail.

    send() - Send an e-mail or e-mails based on the to(), from(), and
    smtp_server() attributes.  Logs any failures with a
    Net::Peep::Log object.

AUTHOR

Collin Starkweather <collin.starkweather@colorado.edu> Copyright (C) 2001

SEE ALSO

perl(1), Net::SMTP, Net::Peep::Log.