Email html with images |
Hi everyone,
I am trying to send an email with a hml message that contain images (e.g. logo image). How can i do that? I tried to attach the image and reference only the name of file in html img..did not work. I tried to have the image from a link, but did not work because the path in site with images can't be accessed directly. Thanks.
Include the same url as when you would display the image on your website.
E.g.: PHP Code: <img src="<?= base_url('./media/images/example.jpg');?>" /> Put the content of your e-mail inside a view. Load the view as a string: PHP Code: $msg = $this->load->view('email/example1',TRUE);
A image set through URL is possible.
I guess you want an attached image file to be shown as an embedded image within the text? Like: Slogan <img src="cid:logo_src" /> Text Text ... ? I haven't checked recently, but I doubt that such a feature is supported by CI_Email class.
(10-27-2017, 02:02 PM)ivantcholakov Wrote: A image set through URL is possible. Thanks Ivantcholakov and others, I found the problem... after put site online, it worked fine. One problem was that the files are case sensitive and the picture extension was .PNG, while I was trying to access .png.!
Thank you, my problem was that it was resolved
|
Welcome Guest, Not a member yet? Register Sign In |