Welcome Guest, Not a member yet? Register   Sign In
Mail attach question
#4

[eluser]Merolen[/eluser]
This worked like a charm Big Grin

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


Messages In This Thread
Mail attach question - by El Forum - 03-18-2008, 05:52 PM
Mail attach question - by El Forum - 03-18-2008, 06:15 PM
Mail attach question - by El Forum - 04-09-2008, 10:30 AM
Mail attach question - by El Forum - 05-04-2008, 07:13 AM



Theme © iAndrew 2016 - Forum software by © MyBB