diff options
author | Brion Vibber <brion@pobox.com> | 2010-05-03 12:25:29 -0700 |
---|---|---|
committer | Brion Vibber <brion@pobox.com> | 2010-05-03 12:25:29 -0700 |
commit | f514f7b722f71fa8b60d0ee88e54d47d4a05af4a (patch) | |
tree | c732b8462093b28d54656e9afa9cdac7ca82bbb7 /extlib/Mail.php | |
parent | 13132d47701111cb3d80ad5e2985356e24a59f3a (diff) | |
parent | df4462611cc71f785c4d8f05d7cebe695c12f6b9 (diff) |
Merge branch 'testing' into 0.9.x
Diffstat (limited to 'extlib/Mail.php')
-rw-r--r--[-rwxr-xr-x] | extlib/Mail.php | 82 |
1 files changed, 25 insertions, 57 deletions
diff --git a/extlib/Mail.php b/extlib/Mail.php index 75132ac2a..3a0c1a9cb 100755..100644 --- a/extlib/Mail.php +++ b/extlib/Mail.php @@ -1,47 +1,22 @@ <?php -/** - * PEAR's Mail:: interface. - * - * PHP versions 4 and 5 - * - * LICENSE: - * - * Copyright (c) 2002-2007, Richard Heyes - * All rights reserved. - * - * Redistribution and use in source and binary forms, with or without - * modification, are permitted provided that the following conditions - * are met: - * - * o Redistributions of source code must retain the above copyright - * notice, this list of conditions and the following disclaimer. - * o Redistributions in binary form must reproduce the above copyright - * notice, this list of conditions and the following disclaimer in the - * documentation and/or other materials provided with the distribution. - * o The names of the authors may not be used to endorse or promote - * products derived from this software without specific prior written - * permission. - * - * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS - * "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT - * LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR - * A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT - * OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, - * SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT - * LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, - * DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY - * THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT - * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE - * OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. - * - * @category Mail - * @package Mail - * @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 $ - * @link http://pear.php.net/package/Mail/ - */ +// +// +----------------------------------------------------------------------+ +// | PHP Version 4 | +// +----------------------------------------------------------------------+ +// | Copyright (c) 1997-2003 The PHP Group | +// +----------------------------------------------------------------------+ +// | This source file is subject to version 2.02 of the PHP license, | +// | that is bundled with this package in the file LICENSE, and is | +// | available at through the world-wide-web at | +// | http://www.php.net/license/2_02.txt. | +// | If you did not receive a copy of the PHP license and are unable to | +// | obtain it through the world-wide-web, please send a note to | +// | license@php.net so we can mail you a copy immediately. | +// +----------------------------------------------------------------------+ +// | Author: Chuck Hagenbuch <chuck@horde.org> | +// +----------------------------------------------------------------------+ +// +// $Id: Mail.php,v 1.17 2006/09/15 03:41:18 jon Exp $ require_once 'PEAR.php'; @@ -51,7 +26,7 @@ require_once 'PEAR.php'; * useful in multiple mailer backends. * * @access public - * @version $Revision: 294747 $ + * @version $Revision: 1.17 $ * @package Mail */ class Mail @@ -107,20 +82,12 @@ class Mail * @return mixed Returns true on success, or a PEAR_Error * containing a descriptive error message on * failure. - * * @access public * @deprecated use Mail_mail::send instead */ function send($recipients, $headers, $body) { - if (!is_array($headers)) { - return PEAR::raiseError('$headers must be an array'); - } - - $result = $this->_sanitizeHeaders($headers); - if (is_a($result, 'PEAR_Error')) { - return $result; - } + $this->_sanitizeHeaders($headers); // if we're passed an array of recipients, implode it. if (is_array($recipients)) { @@ -136,9 +103,10 @@ class Mail } // flatten the headers out. - list(, $text_headers) = Mail::prepareHeaders($headers); + list(,$text_headers) = Mail::prepareHeaders($headers); return mail($recipients, $subject, $body, $text_headers); + } /** @@ -183,9 +151,9 @@ class Mail foreach ($headers as $key => $value) { if (strcasecmp($key, 'From') === 0) { include_once 'Mail/RFC822.php'; - $parser = new Mail_RFC822(); + $parser = &new Mail_RFC822(); $addresses = $parser->parseAddressList($value, 'localhost', false); - if (is_a($addresses, 'PEAR_Error')) { + if (PEAR::isError($addresses)) { return $addresses; } @@ -253,7 +221,7 @@ class Mail $addresses = Mail_RFC822::parseAddressList($recipients, 'localhost', false); // If parseAddressList() returned a PEAR_Error object, just return it. - if (is_a($addresses, 'PEAR_Error')) { + if (PEAR::isError($addresses)) { return $addresses; } |