0
我在cakephp中創建用戶。一切正常,但當我發送電子郵件後,創建用戶顯示500內部服務器錯誤。當我打開調試模式時,它顯示以下錯誤。CakePHP發送電子郵件500內部服務器錯誤
Stack Trace
CORE/Cake/Network/Email/SmtpTransport.php line 96 → SmtpTransport->_auth()
CORE/Cake/Network/Email/CakeEmail.php line 1161 → SmtpTransport->send(CakeEmail)
APP/Plugin/Client/Controller/EmployeesController.php line 176 → CakeEmail->send(string)
[internal function] → EmployeesController->add()
CORE/Cake/Controller/Controller.php line 490 → ReflectionMethod->invokeArgs(EmployeesController, array)
CORE/Cake/Routing/Dispatcher.php line 193 → Controller->invokeAction(CakeRequest)
CORE/Cake/Routing/Dispatcher.php line 167 → Dispatcher->_invoke(EmployeesController, CakeRequest)
APP/webroot/index.php line 118 → Dispatcher->dispatch(CakeRequest, CakeResponse)
我發送電子郵件代碼,
if (!empty($useremail)) {
$Email = new CakeEmail("smtp");
$Email->helpers('Html', 'Form', 'Text');
$Email->emailFormat('html')
->template('Client.newuseraddition', '')
->subject('FIELDTASKS: New User Added')
->to($useremail)
->from('[email protected]', 'FIELDTASKS')
->viewVars(compact('useremail', 'link'))
->send('My message');
}
此行
$Email = new CakeEmail("smtp");
後我打印$Email
變量,它成功地打印。但錯誤的send('My message')
功能.... 問題是什麼here..Any幫助表示讚賞...發生
無論何時收到錯誤,請始終提及_exact_錯誤消息(理想情況下,以可正常讀取的方式從日誌中複製)。另外請始終提及您的_exact_ CakePHP版本(最後一行在'lib/Cake/VERSION.txt'中) - 謝謝! – ndm
這個問題是用smtp用戶名和密碼..我更新了它,現在電子郵件正在工作..順便說一句,我使用cakephp 2.6 – Aamir