我有功能:的CakePHP/CakeEmail - 無法發送EMAIL
public function contact()
{
$dane = $this->data;
echo debug($dane);
$Email = new CakeEmail();
$Email->from(array(''.$this->data['kontakt']['email'].'' => 'Strefagospodarcza.pl'))
->to('[email protected]')
->subject(''.$this->data['kontakt']['temat'].'')
->send(''.$this->data['kontakt']['tresc'].'');
}
而且beforeFunction在控制器
function beforeFilter(){
App::uses('CakeEmail', 'Network/Email');
$this->Auth->userModel = 'User';
$this->Auth->allow('register','login','step2','TakeId','znajdzUzytkownikow');
}
我有錯誤:
Error: An Internal Error Has Occurred.
而且這種類型的堆棧跟蹤:
CORE\Cake\Network\Email\MailTransport.php line 47 → MailTransport->_mail(string, string, string, string, null)
CORE\Cake\Network\Email\CakeEmail.php line 1066 → MailTransport->send(CakeEmail)
APP\Controller\UsersController.php line 477 → CakeEmail->send(string)
[internal function] → UsersController->kontakt()
CORE\Cake\Controller\Controller.php line 486 → ReflectionMethod->invokeArgs(UsersController, array)
CORE\Cake\Routing\Dispatcher.php line 187 → Controller->invokeAction(CakeRequest)
CORE\Cake\Routing\Dispatcher.php line 162 → Dispatcher->_invoke(UsersController, CakeRequest, CakeResponse)
APP\webroot\index.php line 109 → Dispatcher->dispatch(CakeRequest, CakeResponse)
哪裏錯了?我還看不出來,對我來說一切看起來在應用精細:)
可能的重複http://stackoverflow.com/a/22661506/1239506 –