Mail
[ class tree: Mail ] [ index: Mail ] [ all elements ]

Class: Mail

Source Location: /Mail-1.3.0/Mail.php

Class Overview


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


Author(s):

Version:

  • $Revision$

Variables

Methods


Child classes:

Mail_mail
internal PHP-mail() implementation of the PEAR Mail:: interface.
Mail_smtp
SMTP implementation of the PEAR Mail interface. Requires the Net_SMTP class.
Mail_mock
Mock implementation of the PEAR Mail:: interface for testing.
Mail_sendmail
Sendmail implementation of the PEAR Mail:: interface.
Mail_smtpmx
SMTP MX implementation of the PEAR Mail interface. Requires the Net_SMTP class.
Mail_null
Null implementation of the PEAR Mail:: interface.

Inherited Variables

Inherited Methods


Class Details

[line 56]
PEAR's Mail:: interface. Defines the interface for implementing mailers under the PEAR hierarchy, and provides supporting functions useful in multiple mailer backends.
  • Version: $Revision$


[ Top ]


Class Variables

$sep =  "\r\n"

[line 62]

Line terminator used for separating header lines.
  • Access: public

Type:   string


[ Top ]



Method Detail

factory   [line 73]

object Mail factory( string $driver, [array $params = array()])

Provides an interface for generating Mail:: objects of various types
  • Return: a instance of the driver class or if fails a PEAR Error
  • Access: public

Parameters:

string   $driver   —  The kind of Mail:: object to instantiate.
array   $params   —  The parameters to pass to the Mail:: object.

[ Top ]

parseRecipients   [line 234]

mixed 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.
  • Return: An array of forward paths (bare addresses) or a PEAR_Error object if the address list could not be parsed.
  • Access: protected

Parameters:

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

[ Top ]

prepareHeaders   [line 173]

mixed prepareHeaders( array $headers)

Take an array of mail headers and return a string containing text usable in sending a message.
  • Return: 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.
  • Access: protected

Parameters:

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'.

[ Top ]

send   [line 112]

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

Implements Mail::send() function using php's built-in mail() command.
  • Return: Returns true on success, or a PEAR_Error containing a descriptive error message on failure.
  • Deprecated: use Mail_mail::send instead
  • Access: public

Overridden in child classes as:

Mail_mail::send()
Implements Mail_mail::send() function using php's built-in mail() command.
Mail_smtp::send()
Implements Mail::send() function using SMTP.
Mail_mock::send()
Implements Mail_mock::send() function. Silently discards all mail.
Mail_sendmail::send()
Implements Mail::send() function using the sendmail command-line binary.
Mail_smtpmx::send()
Implements Mail::send() function using SMTP direct delivery
Mail_null::send()
Implements Mail_null::send() function. Silently discards all mail.

Parameters:

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.

[ Top ]

_sanitizeHeaders   [line 149]

void _sanitizeHeaders( &$headers, array $headers)

Sanitize an array of mail headers by removing any additional header strings present in a legitimate header's value. The goal of this filter is to prevent mail injection attacks.
  • Access: protected

Parameters:

array   $headers   —  The associative array of headers to sanitize.
   &$headers   — 

[ Top ]


Documentation generated on Sun, 31 Jan 2016 22:00:02 +0000 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.