2
public $default = array(
        'transport' => 'Mail',
        'from' => 'krutarth@gmail.com',
        'charset' => 'utf-8'
        //'headerCharset' => 'utf-8',
    );

    public $smtp = array(
        'transport' => 'Smtp',
        'from' => array('admin@example.com' => 'Project Name'),
        'host' => 'smtp.gmail.com',
        'port' => 465,
        'timeout' => 30,
        'username' => 'krutarth@gmail.com',
        'password' => 'secret',
        'client' => null,
        'log' => false,
        'tls' => true
        //'charset' => 'utf-8',
        //'headerCharset' => 'utf-8',
    );

I have this setting in my confing->email.php on Error page I get formate of email as I defined so controller code is but It says an Internal error occured...

Could not send email.

Error: An Internal Error Has Occurred. Stack Trace

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/HomeController.php line 225 → CakeEmail->send(string)
[internal function] → HomeController->forgot()
CORE/Cake/Controller/Controller.php line 486 → ReflectionMethod->invokeArgs(HomeController, array)
CORE/Cake/Routing/Dispatcher.php line 187 → Controller->invokeAction(CakeRequest)
CORE/Cake/Routing/Dispatcher.php line 162 → Dispatcher->_invoke(HomeController, CakeRequest, CakeResponse)
APP/webroot/index.php line 93 → Dispatcher->dispatch(CakeRequest, CakeResponse)

result of CORE/Cake/Network/Email/MailTransport.php line 47 -> MailTransport->_mail(string,string,string,string,null) is

aryan@***.com' 'Password reset instructions from "App"' '

Please click on the link to activate your account.

Click here to activate

Alternatively, you can also copy paste the below link into your browser:

http://application.com/user/activation/*****/

This email was sent by "App".

'From: krutarth.patel7@gmail.com X-Mailer: CakePHP Email Date: Mon, 05 Aug 2013 19:08:53 +0530 Message-ID: <*@app,cm> MIME-Version: 1.0 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: 8bit' null

I need some help to solve this problem...I have tried Book.cakephp.org and some other question's answer on this site but no effect

I am using Cakephp2.3.8

4

2 回答 2

2

此错误是因为您没有在控制器中指定发件人的帐户(例如 admin@admin.com)。

于 2013-08-25T20:43:41.013 回答
0

我厌倦了到处玩,只是编辑了 CakePHP 代码以输出 $params 数组以查看错误的原始原因。我通过编辑“cake/libs/error.php”文件并在“error500”函数的第176行周围添加以下内容作为前两行来做到这一点,如下所示:

print_r($params);
die();

这给了我一个简单的数组,清楚地告诉我我在数据库中缺少一个已弃用的表。从那里我很快找到了模型中仍在尝试链接到已弃用表的条目。我清理了有问题的模型,现在一切都好起来了。

阅读更多

于 2015-06-18T11:43:24.300 回答