diff --git a/lib/Cake/Network/CakeEmail.php b/lib/Cake/Network/CakeEmail.php index 296df6efa..2e9a1e0fa 100644 --- a/lib/Cake/Network/CakeEmail.php +++ b/lib/Cake/Network/CakeEmail.php @@ -536,6 +536,15 @@ class CakeEmail { * @return void */ public function reset() { + $this->_to = array(); + $this->_from = array(); + $this->_replyTo = array(); + $this->_readReceipt = array(); + $this->_returnPath = array(); + $this->_cc = array(); + $this->_bcc = array(); + $this->_subject = ''; + $this->_headers = array(); } } diff --git a/lib/Cake/tests/Case/Network/CakeEmailTest.php b/lib/Cake/tests/Case/Network/CakeEmailTest.php index 5343c1396..bd6137d22 100644 --- a/lib/Cake/tests/Case/Network/CakeEmailTest.php +++ b/lib/Cake/tests/Case/Network/CakeEmailTest.php @@ -140,6 +140,11 @@ class CakeEmailTest extends CakeTestCase { * @return void */ public function testReset() { + $this->CakeEmail->setTo('cake@cakephp.org'); + $this->assertIdentical($this->CakeEmail->getTo(), array('cake@cakephp.org' => 'cake@cakephp.org')); + + $this->CakeEmail->reset(); + $this->assertIdentical($this->CakeEmail->getTo(), array()); } }