Welcome Guest, Not a member yet? Register   Sign In
Email Class - User-Agent Header
#1

[eluser]Unknown[/eluser]
I'm trying to change the User-Agent and X-Mailer headers sent out by CodeIgniter's email class, so that there's no way that anyone can find out that the website is running on the CI framework.

As per the manual, I've made an application/config/email.php file containing the following:

Code:
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');

$config['mailtype'] = 'html';
$config['useragent'] = 'MyUseragentHere';

When I look at the headers in the incoming emails, they look like this:

Code:
User-Agent: CodeIgniter
X-Mailer: MyUseragentHere

Note that one of the headers has been changed by CI but the other hasn't?!

Please note that calling $this->email->clear() after loading the email library fixed the problem. This isn't desirable though, as I don't want to have to call this every time I want to load the library send an email!

Any suggestions on how to fix without editing the CI system files (want to keep things nice and clean in case of future upgrades etc.) much appreciated.
#2

[eluser]InsiteFX[/eluser]
Maybe extend the email class!

InsiteFX
#3

[eluser]Unknown[/eluser]
[quote author="InsiteFX" date="1286127337"]Maybe extend the email class!

InsiteFX[/quote]

Sorry, could you explain exactly what you mean please?
I'm no PHP rookie but this is my first ever time playing with CI!
#4

[eluser]InsiteFX[/eluser]
Extend Core Classes

InsiteFX




Theme © iAndrew 2016 - Forum software by © MyBB