电子邮件发送到蛋糕我有问题.我的方法看起来像这样:
$this->Email->smtpOptions = array(
'port'=>'465',
'timeout'=>'30',
'auth' => true,
'host' => 'ssl://smtp.gmail.com',
'username'=>'mymail@gmail.com',
'password'=>'mypass',
);
$this->Email->from = "admin@localhost";
$this->Email->to = "my_test_mail@centrum.cz";
$this->Email->subject = "Test";
$this->Email->sendAs = "text";
$this->Email->delivery = 'smtp';
$this->Email->send('Hello message body!');
Run Code Online (Sandbox Code Playgroud)
但当我尝试发送电子邮件时,我得到:
555 5.5.2 Syntax error. l3sm512374fan.0
Run Code Online (Sandbox Code Playgroud)
我需要什么才能使其工作?
谢谢
如何在Grunt任务中创建一个新的空文件?
我想在此过程中设置一个项目并创建一个新文件.该文件将为空.我不想使用不用于此目的的不必要的插件.
有没有一种简单的方法来做这样的事情?
标题基本概括了所有内容.我想测试例如UsersController::admin_index()动作,但是需要授权用户访问此位置,因此当我运行测试时它会将我发送到登录页面,即使我手动登录,也没有进行任何测试.
那么如何在不编辑实际授权代码的情况下强制蛋糕跳过授权?
顺便说一句,如果有帮助,我的testAdminIndex()代码看起来像这样:
function testAdminIndex() {
$result = $this->testAction('/admin/users/index');
debug($result);
}
Run Code Online (Sandbox Code Playgroud) 我需要获取我的User信息,当我打电话时
$this->User->find('first', array('conditions' => array('User.id' => $user_id)));
结果只包含一些字段.
我目前更新了数据库架构.在开发服务器上它运行正常并返回所有字段但在生产服务器上缺少这些新字段.这些服务器具有完全相同的配置.
我已经尝试删除内容,app/tmp/cache/models我正在使用File引擎进行缓存.
该schema.php文件是最新的,文件的内容app/tmp/cache/models表明这些字段存在但我无法在生产服务器上检索它们.唯一的区别可能是数据库和调试级别.我已经尝试复制数据库并将其与开发服务器一起使用,并且运行良好.
我显然无法在生产服务器上将debug设置为2.
你们有没有经历过任何类似的行为?
PS我正在使用Cake 2.3.3
$this->set()在数据设置后重定向到另一个页面时,是否可以显示我传递的数据?
谢谢,EL
php ×4
cakephp ×3
cakephp-1.3 ×3
cakephp-2.0 ×1
email ×1
file ×1
find ×1
gruntjs ×1
redirect ×1
simpletest ×1
smtp ×1
unit-testing ×1