我正在使用CakePHP 2.3.0和CakeEmail。
我可以毫无问题地发送电子邮件。为了删除总是附加到已发送电子邮件的“此电子邮件是用CakePHP框架生成的”,我希望找到并删除它
<p>This email was sent using the <a href="http://cakephp.org">CakePHP Framework</a></p>但它不是默认模板的一部分,希望这可以完成谢谢!
在cakephp 2.3.2中,/app/View/Emails/html/default.ctp的内容如下所示
<?php
/**
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.View.Emails.html
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<?php
$content = explode("\n", $content);
foreach ($content as $line):
echo '<p> ' . $line . "</p>\n";
endforeach;
?>/app/View/Emails/html/default.ctp的内容如下所示
<?php
/**
*
* PHP 5
*
* CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
* Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
*
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
* @link http://cakephp.org CakePHP(tm) Project
* @package app.View.Emails.text
* @since CakePHP(tm) v 0.10.0.1076
* @license MIT License (http://www.opensource.org/licenses/mit-license.php)
*/
?>
<?php echo $content; ?>那么,我该怎么做才能删除这行看不见的代码呢?希望能做到这一点谢谢!
发布于 2013-06-06 14:44:15
我假设您从app\View\Layouts\Emails\html\default.ctp中删除了这一行,但是可以发送两种格式。Html、文本或两者都有。html和文本格式都有自己的布局。发送的默认格式是文本,除非用emailFormat(...)方法另外设置,所以如果您还没有这样做,请尝试在app\View\Layouts\Emails\text\default.ctp中修改文本格式的布局。
发布于 2013-06-06 20:23:12
please can you comment last php tag from following file
1) app\View\Layouts\Emails\text\default.ctp
2) app\View\Layouts\Emails\html\default.ctp
and then check it works finehttps://stackoverflow.com/questions/16953100
复制相似问题