diff --git a/lib/Cake/Network/CakeEmail.php b/lib/Cake/Network/CakeEmail.php index fd8161fd8..69c2f78c3 100644 --- a/lib/Cake/Network/CakeEmail.php +++ b/lib/Cake/Network/CakeEmail.php @@ -567,6 +567,7 @@ class CakeEmail { } if ($this->_messageId !== false) { if ($this->_messageId === true) { + App::uses('String', 'Utility'); $headers['Message-ID'] = '<' . String::UUID() . '@' . env('HTTP_HOST') . '>'; } else { $headers['Message-ID'] = $this->_messageId; @@ -808,7 +809,7 @@ class CakeEmail { public function send($content = null) { if (is_string($this->_config)) { if (!config('email')) { - throw new SocketException(__d('cake', '%s not found.', APP . DS . 'email.php')); + throw new SocketException(__d('cake', '%s not found.', APP . 'config' . DS . 'email.php')); } $configs = new EMAIL_CONFIG(); if (!isset($configs->{$this->_config})) { @@ -1077,6 +1078,7 @@ class CakeEmail { protected function _render($content) { $viewClass = $this->_viewRender; + App::uses('View', 'View'); if ($viewClass !== 'View') { list($plugin, $viewClass) = pluginSplit($viewClass, true); $viewClass .= 'View'; diff --git a/lib/Cake/tests/Case/Network/CakeEmailTest.php b/lib/Cake/tests/Case/Network/CakeEmailTest.php index c20c7b989..368c1e7ff 100644 --- a/lib/Cake/tests/Case/Network/CakeEmailTest.php +++ b/lib/Cake/tests/Case/Network/CakeEmailTest.php @@ -110,7 +110,7 @@ class CakeEmailTest extends CakeTestCase { $this->CakeEmail = new TestCakeEmail(); App::build(array( - 'views' => array(TEST_CAKE_CORE_INCLUDE_PATH . 'tests' . DS . 'test_app' . DS . 'views'. DS) + 'views' => array(LIBS . 'tests' . DS . 'test_app' . DS . 'View'. DS) )); } @@ -421,6 +421,7 @@ class CakeEmailTest extends CakeTestCase { $this->CakeEmail->from('cake@cakephp.org'); $this->CakeEmail->to(array('you@cakephp.org' => 'You')); $this->CakeEmail->subject('My title'); + $this->CakeEmail->config(array('empty')); $result = $this->CakeEmail->send("Here is my body, with multi lines.\nThis is the second line.\r\n\r\nAnd the last."); $this->assertTrue($result); @@ -450,6 +451,7 @@ class CakeEmailTest extends CakeTestCase { $this->CakeEmail->from('cake@cakephp.org'); $this->CakeEmail->to(array('you@cakephp.org' => 'You')); $this->CakeEmail->subject('My title'); + $this->CakeEmail->config(array('empty')); $this->CakeEmail->layout('default', 'default'); $result = $this->CakeEmail->send(); diff --git a/lib/Cake/tests/Case/Network/Email/SmtpTransportTest.php b/lib/Cake/tests/Case/Network/Email/SmtpTransportTest.php index a65e3b3cb..332e7b15f 100644 --- a/lib/Cake/tests/Case/Network/Email/SmtpTransportTest.php +++ b/lib/Cake/tests/Case/Network/Email/SmtpTransportTest.php @@ -17,6 +17,7 @@ * @license MIT License (http://www.opensource.org/licenses/mit-license.php) */ App::uses('CakeEmail', 'Network'); +App::uses('AbstractTransport', 'Network/Email'); App::uses('SmtpTransport', 'Network/Email'); /**