Alright, I just want to improve the best answer here.
Credit goes to @Tekniskt, and the only difference here is that the settings you might have in /application/config/email.php are ignored, which hurts, especially if you are using custom STMP settings.
Here's the full code of the class MY_Email.php I've improved from the answer above:
class MY_Email extends CI_Email {
public function __construct($config = array())
{
if (count($config) > 0)
{
$this->initialize($config);
}
else
{
$this->_smtp_auth = ($this->smtp_user == '' AND $this->smtp_pass == '') ? FALSE : TRUE;
$this->_safe_mode = ((boolean)@ini_get("safe_mode") === FALSE) ? FALSE : TRUE;
}
log_message('debug', "Email Class Initialized");
}
// this will allow us to add headers whenever we need them
public function set_header($header, $value){
$this->_headers[$header] = $value;
}
}
Hope it helps! :)
I did my test, and it seems now /config/email.php is included and settings are passed properly.
Cheers and thanks for the answer! :)