[eluser]Merolen[/eluser]
This worked like a charm
Here is what I've learned from this.
First off, the MY_Email.php has to be placed in application/<and so on>/libraries.
The extension:
Guess the function could be called attach, but I don't want it to override the original function.
Code:
class MY_Email extends CI_Email {
var $_attach_new_name = array();
function My_Email() {
parent::CI_Email();
}
/**
* Assign file attachments
*
* @access public
* @param string
* @return string
*/
function new_attach($filename, $new_filename, $disposition = 'attachment')
{
$this->_attach_name[] = $filename;
$this->_attach_new_name[] = $new_filename;
$this->_attach_type[] = $this->_mime_types(next(explode('.', basename($new_filename))));
$this->_attach_disp[] = $disposition; // Can also be 'inline' Not sure if it matters
}
}
And then, in the lib Email.php at line 1030isj:
Inside the for loop where &filename;is set I added/edited this:
Code:
$new_filename = $this->_attach_new_name[$i]; //Added
$basename = basename($new_filename); //Edit