"Fixes #3634, Email Component and PHP4. Double headers being set for To: and Subject:"

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@6047 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
phpnut 2007-11-22 17:12:03 +00:00
parent eba8f6770b
commit d4a0f8300e

View file

@ -424,7 +424,9 @@ class EmailComponent extends Object{
* @access private
*/
function __createHeader() {
$this->__header = 'To: ' . $this->__formatAddress($this->to) . $this->_newLine;
if ($this->delivery == 'smtp') {
$this->__header = 'To: ' . $this->__formatAddress($this->to) . $this->_newLine;
}
$this->__header .= 'From: ' . $this->__formatAddress($this->from) . $this->_newLine;
if (!empty($this->replyTo)) {
@ -452,7 +454,9 @@ class EmailComponent extends Object{
}
$this->__header .= 'Bcc: ' . substr($addresses, 2) . $this->_newLine;
}
$this->__header .= 'Subject: ' . $this->subject . $this->_newLine;
if ($this->delivery == 'smtp') {
$this->__header .= 'Subject: ' . $this->subject . $this->_newLine;
}
$this->__header .= 'X-Mailer: ' . $this->xMailer . $this->_newLine;
if (!empty($this->headers)) {