Email Body Image - Code Igniter

Asked

Viewed 108 times

0

I’m having trouble attaching an image to the E-email body using the standard 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.

Someone can help?

  • you are setting the image ? $mail->Addattachment

  • or $mail->Addembeddedimage

1 answer

1

Documentation:

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

Solved.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.