CI_Email::attachment_cid()

attachment_cid($filename)

Parameters:
  • $filename (string) – Existing attachment filename
Returns:

Attachment Content-ID or FALSE if not found

Return type:

string

Sets and returns an attachment’s Content-ID, which enables your to embed an inline (picture) attachment into HTML. First parameter must be the already attached file name.

$filename = '/img/photo1.jpg';
$this->email->attach($filename);
foreach ($list as $address)
{
        $this->email->to($address);
        $cid = $this->email->attachment_cid($filename);
        $this->email->message('<img src="cid:'. $cid .'" alt="photo1" />');
        $this->email->send();
}

Note

Content-ID for each e-mail must be re-created for it to be unique.

doc_CodeIgniter
2016-10-15 16:31:28
Comments
Leave a Comment

Please login to continue.