首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >cakephp 2.3.0 CakeEmail

cakephp 2.3.0 CakeEmail
EN

Stack Overflow用户
提问于 2013-06-06 11:07:58
回答 2查看 749关注 0票数 0

我正在使用CakePHP 2.3.0和CakeEmail。

我可以毫无问题地发送电子邮件。为了删除总是附加到已发送电子邮件的“此电子邮件是用CakePHP框架生成的”,我希望找到并删除它

代码语言:javascript
复制
<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的内容如下所示

代码语言:javascript
复制
 <?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的内容如下所示

代码语言:javascript
复制
    <?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; ?>

那么,我该怎么做才能删除这行看不见的代码呢?希望能做到这一点谢谢!

EN

回答 2

Stack Overflow用户

发布于 2013-06-06 14:44:15

我假设您从app\View\Layouts\Emails\html\default.ctp中删除了这一行,但是可以发送两种格式。Html、文本或两者都有。html和文本格式都有自己的布局。发送的默认格式是文本,除非用emailFormat(...)方法另外设置,所以如果您还没有这样做,请尝试在app\View\Layouts\Emails\text\default.ctp中修改文本格式的布局。

票数 1
EN

Stack Overflow用户

发布于 2013-06-06 20:23:12

代码语言:javascript
复制
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 fine
票数 0
EN
页面原文内容由Stack Overflow提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://stackoverflow.com/questions/16953100

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档