Email Body Image - Code Igniter

0

I'm having trouble mating an image in the body of the E-mail using the default code igniter library.

I've done it like this:

$cid = $this->email->attach('media/teste.jpg','inline');
$dados['cid']= $cid;
$emailbody = $this->load>view('proposta/template.php',$dados,true);
$this->email->message($emailbody);

In view:

 <img src='cid:<?= $cid?>' alt="photo1" height="42" width="42" />'

In case the attachment happens, but in the view the image in the body does not appear.

Can anyone help?

    
asked by anonymous 08.08.2018 / 21:12

1 answer

1

Documentation:

$cid = $this->email->attachment_cid($filename);
$this->email->message('<img src="cid:'. $cid .'" alt="photo1" />');
$this->email->send();

Resolved.

    
08.08.2018 / 21:51