代码之家  ›  专栏  ›  技术社区  ›  chigley

CodeIgniter电子邮件类-用户代理标头

  •  0
  • chigley  · 技术社区  · 14 年前

    我正在尝试更改CodeIgniter的email类发送的用户代理和X-Mailer头,以便任何人都无法发现该网站正在CI框架上运行。

    application/config/email.php 包含以下内容的文件:

    <?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');
    
    $config['mailtype'] = 'html';
    $config['useragent'] = 'MyUseragentHere';
    

    当我查看收到的电子邮件的标题时,它们看起来是这样的:

    User-Agent: CodeIgniter
    X-Mailer: MyUseragentHere
    

    1 回复  |  直到 14 年前
        1
  •  1
  •   fire    14 年前

    $this->email->clear() 您不必这样做,但这是它在代码中设置用户代理的地方。

    如果仍然没有改变,就改变 var $useragent 暂时在系统文件中查看是否有效。