Packageindex Classtrees Modulegroups Elementlist Report XML Files

File: c:/www/apache/doc2//pear/Mail.php
PEAR 2000/12/03 -

Mail

PEAR
   |
  +-- Mail

PEAR's Mail:: interface. Defines the interface for implementing

 

private class Mail extends PEAR

PEAR's Mail:: interface. Defines the interface for implementing
mailers under the PEAR hierarchy, and provides supporting functionsuseful 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_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

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
kind of Mail:: object to instantiate.
array $params = >>array()<<
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
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
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
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
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 sendmailor an smtp server with the rcpt to: command.

Parameter
mixed $recipients
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