YaBB3::Sendmail - Mailing Class.


Name

YaBB3::Sendmail - Mailing Class.


Synopsis

  use YaBB3::Sendmail;
  # creation of Sendmail-object
  my $sendmail = new YaBB3::Sendmail;
  # sending an email. specify valid email adresses in $to and $from
  $sendmail->send( $to, $from, $subject, $body);
  # error handling
  return $Y->errorDisplay("An error occured while trying to send an email!") if $Y->isError();


Overview

The general mailing class. It basicly provides one method to send emails through different mail programs. It's planned to add a method which can handle multiple user-objects and use their email-addresses.


Description

The send method has to be used to send an email. All other methods should be seen as private and unaccessable. You have to call it with the 4 important parameters: the recipients- and senders email-address as well as the mail-subject and messagebody.

Required settings

Required are some settings gathered from the YaBB3 Settings-table. These are:


Reference

Used Packages

  YaBB3::Base

Exports

  Default   $Y $VERSION
  Optional
  Tags

Object Super Classes

  YaBB3::Base

Object Methods

new

  Returns
  /%             The constructed object reference.

Construct and return a new sendmail object.

send

    $to          The sender's valid email address
    $from        The recipient's valid email address
    $subject     Subject of the email
    $message     Message-body of the email

Sends an email using the mail-program specified in the settings-table. The required settings in detail can be found here .

Private Object Methods

$_mailViaSendmail

    $to          The sender's valid email address
    $from        The recipient's valid email address
    $subject     Subject of the email
    $message     Message-body of the email
    %mailheader  Expects an hash with the keys "to" and "from" set to the respective header-information

Sends an email using Sendmail. This method doesn't check for any validity of the parameters. Malicious code and other checks have to be done before calling!

$_mailViaSMTP

    $to          The sender's valid email address
    $from        The recipient's valid email address
    $subject     Subject of the email
    $message     Message-body of the email
    %mailheader  Expects an hash with the keys "to" and "from" set to the respective header-information

Sends an email using SMTP. This method doesn't check for any validity of the parameters. Malicious code and other checks have to be done before calling!

$_mailViaNetSMTP

    $to          The sender's valid email address
    $from        The recipient's valid email address
    $subject     Subject of the email
    $message     Message-body of the email
    %mailheader  Expects an hash with the keys "to" and "from" set to the respective header-information

Sends an email using Net::SMTP. This method doesn't check for any validity of the parameters. Malicious code and other checks have to be done before calling!


Author

Maurizio Laudone Torsten Mrotz (tmrotz@yabbforum.com)

Copyright ©2002, YaBB 3 Development Team. All Rights Reserved.
You may distribute this module under the terms of YaBB 3.
 YaBB3::Sendmail - Mailing Class.