我需要幫助的人。我無法得到這個工作。你可以幫幫我嗎?CakeEmail無法發送電子郵件
在此先感謝!
配置/ email.php
public $default = array(
'transport' => 'Mail',
'from' => '[email protected]',
'charset' => 'utf-8',
'headerCharset' => 'utf-8',
);
FeedbacksController.php
App::uses('AppController', 'Controller');
App::uses('CakeEmail', 'Network/Email');
*
*
*
public function send() {
$email = new CakeEmail('default');
$email->emailFormat('text')
->to('[email protected]')
->from('[email protected]')
->send('Message Body');
}
上面的代碼給我一個錯誤:
無法發送電子郵件。
Error: An Internal Error Has Occurred.
你有調試級別設置爲2? (在'app/Config/core.php'中有'Configure :: write'('debug',2);'當設置這個錯誤時,你會得到關於錯誤的更多信息嗎? – Josh
是的,它被設置爲2 – njay
CORE \ Cake \網絡\電子郵件\ CakeEmail.php線972→MailTransport->發送(CakeEmail) APP \控制器\ FeedbacksController.php線82→CakeEmail->發送() [內部功能]→FeedbacksController->發送() CORE \蛋糕\控制器\ Controller.php這樣線488→ReflectionMethod-> invokeArgs(FeedbacksController,數組) CORE \蛋糕\路由\ Dispatcher.php線103→控制器 - > invokeAction(CakeRequest) CORE \蛋糕\路由\ Dispatcher.php線85→分派器 - > _調用(FeedbacksController,CakeRequest,CakeResponse) APP \根目錄\的index.php線96→Dispatcher->調度(CakeRequest,CakeResponse) – njay