Welcome Guest, Not a member yet? Register   Sign In
CI3 inline images in email using buffer string
#2

Just for reference, I extended the Email class with a custom method to be used with buffer strings:
Code:
    public function buffered_attachment_cid($filename)
    {
        for ($i = 0, $c = count($this->_attachments); $i < $c; $i++)
        {

            for ( $j = 0, $n = count( $this->_attachments[$i]['name'] ); $j < $n; $j++ )
            {
                if ($this->_attachments[$i]['name'][$j] === $filename)
                {
                    $this->_attachments[$i]['multipart'] = 'related';
                    $this->_attachments[$i]['cid'] = uniqid(basename($this->_attachments[$i]['name'][$j]).'@');
                    return $this->_attachments[$i]['cid'];
                }
            }
        }

        return FALSE;
    }
This one handles inline buffer string images correctly.
Reply


Messages In This Thread
RE: CI3 inline images in email using buffer string - by ludis - 02-16-2021, 01:35 PM



Theme © iAndrew 2016 - Forum software by © MyBB