<?php
/**
- * PEAR's Mail:: interface.
+ * PEAR's Mail:: interface.
*
- * PHP versions 4 and 5
+ * PHP version 5
*
* LICENSE:
*
* @author Chuck Hagenbuch <chuck@horde.org>
* @copyright 1997-2010 Chuck Hagenbuch
* @license http://opensource.org/licenses/bsd-license.php New BSD License
- * @version CVS: $Id: Mail.php 294747 2010-02-08 08:18:33Z clockwerx $
+ * @version CVS: $Id$
* @link http://pear.php.net/package/Mail/
*/
* mailers under the PEAR hierarchy, and provides supporting functions
* useful in multiple mailer backends.
*
- * @access public
- * @version $Revision: 294747 $
+ * @version $Revision$
* @package Mail
*/
class Mail
* Line terminator used for separating header lines.
* @var string
*/
- var $sep = "\r\n";
+ public $sep = "\r\n";
/**
* Provides an interface for generating Mail:: objects of various
*
* @param string $driver The kind of Mail:: object to instantiate.
* @param array $params The parameters to pass to the Mail:: object.
+ *
* @return object Mail a instance of the driver class or if fails a PEAR Error
- * @access public
*/
- function &factory($driver, $params = array())
+ public static function factory($driver, $params = array())
{
$driver = strtolower($driver);
@include_once 'Mail/' . $driver . '.php';
* containing a descriptive error message on
* failure.
*
- * @access public
* @deprecated use Mail_mail::send instead
*/
- function send($recipients, $headers, $body)
+ public function send($recipients, $headers, $body)
{
if (!is_array($headers)) {
return PEAR::raiseError('$headers must be an array');
* filter is to prevent mail injection attacks.
*
* @param array $headers The associative array of headers to sanitize.
- *
- * @access private
*/
- function _sanitizeHeaders(&$headers)
+ protected function _sanitizeHeaders(&$headers)
{
foreach ($headers as $key => $value) {
$headers[$key] =
* otherwise returns an array containing two
* elements: Any From: address found in the headers,
* and the plain text version of the headers.
- * @access private
*/
- function prepareHeaders($headers)
+ protected function prepareHeaders($headers)
{
$lines = array();
$from = null;
*
* @return mixed An array of forward paths (bare addresses) or a PEAR_Error
* object if the address list could not be parsed.
- * @access private
*/
- function parseRecipients($recipients)
+ protected function parseRecipients($recipients)
{
include_once 'Mail/RFC822.php';
// Parse recipients, leaving out all personal info. This is
// for smtp recipients, etc. All relevant personal information
// should already be in the headers.
- $addresses = Mail_RFC822::parseAddressList($recipients, 'localhost', false);
+ $Mail_RFC822 = new Mail_RFC822();
+ $addresses = $Mail_RFC822->parseAddressList($recipients, 'localhost', false);
// If parseAddressList() returned a PEAR_Error object, just return it.
if (is_a($addresses, 'PEAR_Error')) {