[CI 1.7+] Email Class - useragent not configurable |
[eluser]a&w[/eluser]
This is pretty easy to verify if this is a bug or not. Just try to change the useragent and then do print_debugger() and you should see the useragent is not changed. When you do: Code: $this->CI->email->initialize($config); that will call: Code: function initialize($config = array()) Code: function clear($clear_attachments = FALSE) After doing clear() it then does: Code: foreach ($config as $key => $val) Code: $this->_set_header('User-Agent', $this->useragent); During send() 'X-Mailer' is correctly set: Code: function _build_headers() However later, during _write_headers(), it's using $this->_headers (which is still 'CodeIgniter'): Code: function _write_headers()
[eluser]sophistry[/eluser]
yes, i just hit this bug too - consider it verified. i have posted it in the bug tracker here: http://codeigniter.com/bug_tracker/bug/6643/ this is how i fixed it - not sure if it is a long-term fix, but it let me set the User-Agent header in my email. around line 922 in the _build_headers() function you'll see a list of _set_header calls, add this one. Code: $this->_set_header('User-Agent', $this->useragent); |
Welcome Guest, Not a member yet? Register Sign In |