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

Class: Mail2

Source Location: /Mail2-0.1.1/Mail2.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:

Mail2_sendmail
Sendmail implementation of the PEAR Mail:: interface.
Mail2_mock
Mock implementation of the PEAR Mail:: interface for testing.
Mail2_null
Null implementation of the PEAR Mail:: interface.
Mail2_mail
internal PHP-mail() implementation of the PEAR Mail:: interface.
Mail2_smtp
SMTP implementation of the PEAR Mail interface. Requires the Net_SMTP2 class.
Mail2_smtpmx
SMTP MX implementation of the PEAR Mail interface. Requires the Net_SMTP2 class.

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.

Type:   string


[ Top ]



Method Detail

factory   [line 72]

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
  • 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 231]

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.
  • Return: An array of forward paths (bare addresses)
  • 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 171]

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 109]

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

Implements Mail::send() function using php's built-in mail() command.
  • Return: Returns true on success
  • Deprecated: use Mail_mail::send instead
  • Access: public

Overridden in child classes as:

Mail2_sendmail::send()
Implements Mail::send() function using the sendmail command-line binary.
Mail2_mock::send()
Implements Mail_mock::send() function. Silently discards all mail.
Mail2_null::send()
Implements Mail_null::send() function. Silently discards all mail.
Mail2_mail::send()
Implements Mail_mail::send() function using php's built-in mail() command.
Mail2_smtp::send()
Implements Mail::send() function using SMTP.
Mail2_smtpmx::send()
Implements Mail::send() function using SMTP direct delivery

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 147]

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 Mon, 11 Mar 2019 16:04:25 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.