Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: /home/cch/www/pear/Mail.php
PEAR Repository -

Mail

PEAR
   |
  +-- Mail

PEAR's Mail:: interface. Defines the interface for implementing
mailers under the PEAR hierarchy, and provides supporting functions
useful in multiple mailer backends.

 

private class Mail extends PEAR

PEAR's Mail:: interface. Defines the interface for implementing
mailers under the PEAR hierarchy, and provides supporting functions
useful in multiple mailer backends.

AuthorsStig Bakken <ssb@fast.no>
SincePHP 4.0.2

 
Direct known subclasses: Mail_sendmail, Mail_smtp

Methods inherited from PEAR

pear, _pear, iserror, pear_error, getmode, getcallback, getmessage, getcode, gettype, getdebuginfo, tostring, _pear_call_destructors

Public Method Summary

void

factory(string $mailer_type, [ array $params ])

Provides an interface for generating Mail:: objects of various
mixed

send(mixed $recipients, array $headers, string $body)

Implements Mail::send() function using php's built-in mail()

Private Method Summary

mixed

prepareHeaders(array $headers)

Take an array of mail headers and return a string containing
array

parseRecipients(mixed $recipients)

Take a set of recipients and parse them, returning an array of

Fields inherited from PEAR

$_debug, $error_message_prefix, $error_prepend, $error_append, $mode, $level, $code, $message, $debuginfo, $file, $line

Public Method Details

factory

public void factory( string $mailer_type, [ array $params ] )

  Provides an interface for generating Mail:: objects of various
types

Parameter
string $mailer_type
The kind of Mail:: object to instantiate.
array $params = >>array()<<
The parameters to pass to the Mail:: object.
Returns void


send

public mixed send( mixed $recipients, array $headers, string $body )

  Implements Mail::send() function using php's built-in mail()
command.

Parameter
mixed $recipients
Either a comma-seperated list of recipients
(RFC822 compliant), or an array of recipients,
each RFC822 valid. This may contain recipients not
specified in the headers, for Bcc:, resending
messages, etc.
array $headers
The array of headers to send with the mail, in an
associative array, where the array key is the
header name (ie, 'Subject'), and the array value
is the header value (ie, 'test'). The header
produced from those values would be 'Subject:
test'.
string $body
The full text of the message body, including any
Mime parts, etc.
Returns mixed

Returns true on success, or a PEAR_Error
containing a descriptive error message on
failure.


Private Method Details

prepareHeaders

private mixed prepareHeaders( array $headers )

  Take an array of mail headers and return a string containing
text usable in sending a message.

Parameter
array $headers
The array of headers to prepare, in an associative
array, where the array key is the header name (ie,
'Subject'), and the array value is the header
value (ie, 'test'). The header produced from those
values would be 'Subject: test'.
Returns mixed

Returns false if it encounters a bad address,
otherwise returns an array containing two
elements: Any From: address found in the headers,
and the plain text version of the headers.


parseRecipients

private array parseRecipients( mixed $recipients )

  Take a set of recipients and parse them, returning an array of
bare addresses (forward paths) that can be passed to sendmail
or an smtp server with the rcpt to: command.

Parameter
mixed $recipients
Either a comma-seperated list of recipients
(RFC822 compliant), or an array of recipients,
each RFC822 valid.
Returns array

An array of forward paths (bare addresses).



Packageindex Classtrees Modulegroups Elementlist Report XML Files
PHPDoc 1.0beta