2013-06-06 26 views
0

我正在使用CakePHP 2.3.0和CakeEmail。cakephp 2.3.0 CakeEmail

我可以毫無問題地發送電子郵件。 爲了去除 那總是附加到發送的電子郵件 我期待找到並刪除

<p>This email was sent using the <a href="http://cakephp.org">CakePHP Framework</a></p> 

,但它不是默認模板 希望這能成爲其中的一部分「這封電子郵件是使用CakePHP框架生成」完成 非常感謝!

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; ?> 

所以我該怎麼辦去除的代碼 希望這個看不見的線可以做到這一點 太謝謝你了!

回答

1

我假設你從app\View\Layouts\Emails\html\default.ctp中刪除了這一行,但有兩種格式可以發送。 HTML,文本或兩者兼而有之。 html和文本格式都有自己的佈局。默認格式是發送文本,除非另有設置emailFormat(...)方法,所以如果您還沒有這樣做,請嘗試修改文本格式的佈局。

0
​​