- NAME
- SYNOPSIS
- DESCRIPTION

- new - Constructor method
- smtp
- sendmail

- COPYRIGHT
- VERSION

# NAME

GT::Mail::Send - Module to send emails

# SYNOPSIS

        use GT::Mail::Send;

        # $mail_object must be a GT::Mail object
        my $send = new GT::Mail::Send (
            mail  => $mail_object,
            host  => 'smtp.gossamer-threads.com',
            debug => 1
        );

        $send->smtp or die $GT::Mail::Send::error;

# DESCRIPTION

GT::Mail::Send is an object interface to sending email over either SMTP or Sendmail. This module is used internally to GT::Mail.

## new - Constructor method

Returns a new GT::Mail::Send object. You must specify either the smtp host or a path to sendmail. This method is inherented from GT::Base. The arguments can be in the form of a hash or hash ref.

debug

  Sets the debug level for this instance of GT::Mail::Send.

mail

  Specify the mail object to use. This must be a GT::Mail object and must contain an email, either passed in or parsed in.

host

  Specify the host to use when sending by SMTP.

port

  Specify the port to use when sending over SMTP. Defaults to 25.

helo

  The hostname to output on the HELO/EHLO line on an SMTP connection. Defaults to $ENV{SERVER_NAME} or the system hostname (if Sys::Hostname is available).

path

  Specify the path to sendmail when sending over sendmail. If the binary passed in does not exist, undef will be returned and the error set in GT::Mail::Send::error.

flags

  Specify the flags used to call sendmail. Defaults to -t -oi -oeq, see the Sendmail guilde for sendmail for more info on the parameters to sendmail.

## smtp

Class or instance method. Sends the passed in email over SMTP. If called as a class method, the parameters passed in will be used to call new(). Returns true on error, false otherwise.

## sendmail

Class or instance method. Send the passed in email to sendmail using the specified path and flags. If called as a class method all additional arguments are passed to the `new()` method. Returns true on success and false otherwise.

# COPYRIGHT

Copyright (c) 2004 Gossamer Threads Inc. All Rights Reserved. http://www.gossamer-threads.com/

# VERSION

Revision: $Id: Send.pm,v 1.54 2007/08/01 23:35:16 brewt Exp $