import v1.1.0_beta1 | 2009-08-21
This commit is contained in:
@ -16,7 +16,7 @@
|
||||
* @package Zend_Mail
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Part.php 12519 2008-11-10 18:41:24Z alexander $
|
||||
* @version $Id: Part.php 13591 2009-01-11 09:04:09Z beberlei $
|
||||
*/
|
||||
|
||||
|
||||
@ -337,14 +337,14 @@ class Zend_Mail_Part implements RecursiveIterator, Zend_Mail_Part_Interface
|
||||
|
||||
$lowerName = strtolower($name);
|
||||
|
||||
if (!isset($this->_headers[$lowerName])) {
|
||||
if ($this->headerExists($name) == false) {
|
||||
$lowerName = strtolower(preg_replace('%([a-z])([A-Z])%', '\1-\2', $name));
|
||||
if (!isset($this->_headers[$lowerName])) {
|
||||
if($this->headerExists($lowerName) == false) {
|
||||
/**
|
||||
* @see Zend_Mail_Exception
|
||||
*/
|
||||
require_once 'Zend/Mail/Exception.php';
|
||||
throw new Zend_Mail_Exception("no Header with Name $name found");
|
||||
throw new Zend_Mail_Exception("no Header with Name $name or $lowerName found");
|
||||
}
|
||||
}
|
||||
$name = $lowerName;
|
||||
@ -365,6 +365,22 @@ class Zend_Mail_Part implements RecursiveIterator, Zend_Mail_Part_Interface
|
||||
|
||||
return $header;
|
||||
}
|
||||
|
||||
/**
|
||||
* Check wheater the Mail part has a specific header.
|
||||
*
|
||||
* @param string $name
|
||||
* @return boolean
|
||||
*/
|
||||
public function headerExists($name)
|
||||
{
|
||||
$name = strtolower($name);
|
||||
if(isset($this->_headers[$name])) {
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a specific field from a header like content type or all fields as array
|
||||
@ -402,6 +418,21 @@ class Zend_Mail_Part implements RecursiveIterator, Zend_Mail_Part_Interface
|
||||
return $this->getHeader($name, 'string');
|
||||
}
|
||||
|
||||
/**
|
||||
* Isset magic method proxy to hasHeader
|
||||
*
|
||||
* This method is short syntax for Zend_Mail_Part::hasHeader($name);
|
||||
*
|
||||
* @see Zend_Mail_Part::hasHeader
|
||||
*
|
||||
* @param string
|
||||
* @return boolean
|
||||
*/
|
||||
public function __isset($name)
|
||||
{
|
||||
return $this->headerExists($name);
|
||||
}
|
||||
|
||||
/**
|
||||
* magic method to get content of part
|
||||
*
|
||||
|
@ -11,13 +11,13 @@
|
||||
* If you did not receive a copy of the license and are unable to
|
||||
* obtain it through the world-wide-web, please send an email
|
||||
* to license@zend.com so we can send you a copy immediately.
|
||||
*
|
||||
*
|
||||
* @category Zend
|
||||
* @package Zend_Mail
|
||||
* @subpackage Transport
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Abstract.php 8064 2008-02-16 10:58:39Z thomas $
|
||||
* @version $Id: Abstract.php 15934 2009-06-08 02:05:48Z yoshida@zend.co.jp $
|
||||
*/
|
||||
|
||||
|
||||
@ -37,7 +37,7 @@ require_once 'Zend/Mime.php';
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
*/
|
||||
abstract class Zend_Mail_Transport_Abstract
|
||||
abstract class Zend_Mail_Transport_Abstract
|
||||
{
|
||||
/**
|
||||
* Mail body
|
||||
@ -144,11 +144,11 @@ abstract class Zend_Mail_Transport_Abstract
|
||||
. $this->EOL
|
||||
. " " . 'boundary="' . $boundary . '"'
|
||||
);
|
||||
$this->_headers['MIME-Version'] = array('1.0');
|
||||
|
||||
$this->boundary = $boundary;
|
||||
}
|
||||
|
||||
$this->_headers['MIME-Version'] = array('1.0');
|
||||
|
||||
return $this->_headers;
|
||||
}
|
||||
|
||||
|
@ -17,15 +17,10 @@
|
||||
* @subpackage Transport
|
||||
* @copyright Copyright (c) 2005-2008 Zend Technologies USA Inc. (http://www.zend.com)
|
||||
* @license http://framework.zend.com/license/new-bsd New BSD License
|
||||
* @version $Id: Smtp.php 12519 2008-11-10 18:41:24Z alexander $
|
||||
* @version $Id: Smtp.php 15577 2009-05-14 12:43:34Z matthew $
|
||||
*/
|
||||
|
||||
|
||||
/**
|
||||
* @see Zend_Loader
|
||||
*/
|
||||
require_once 'Zend/Loader.php';
|
||||
|
||||
/**
|
||||
* @see Zend_Mime
|
||||
*/
|
||||
@ -192,7 +187,10 @@ class Zend_Mail_Transport_Smtp extends Zend_Mail_Transport_Abstract
|
||||
if ($this->_auth) {
|
||||
$connectionClass .= '_Auth_' . ucwords($this->_auth);
|
||||
}
|
||||
Zend_Loader::loadClass($connectionClass);
|
||||
if (!class_exists($connectionClass)) {
|
||||
require_once 'Zend/Loader.php';
|
||||
Zend_Loader::loadClass($connectionClass);
|
||||
}
|
||||
$this->setConnection(new $connectionClass($this->_host, $this->_port, $this->_config));
|
||||
$this->_connection->connect();
|
||||
$this->_connection->helo($this->_name);
|
||||
|
Reference in New Issue
Block a user