Reputation: 43
how to display images from local, so they can appear in gmail I have tried it as below
{{ $message->embed(public_path().'/images/img/rounder-up.png') }}
but the image still isn't found
Upvotes: 2
Views: 1948
Reputation: 6272
So you are sending your local image path in gmail to display image but before showing the image in gmail google proxy tries to access the url and because image is available in your local only so google can't access it via proxy and so it does not appear in your gmail,
and if you inspect your image in gmail you can check that google proxy also append your url with some random string URL like below:
and if you remove the part before #
then it will appear in gmail too, but it is appearing because localhost is running in your computer
The solution is to ensure that the path you are using is one accessible outside of your local network; for example, by hosting the images on an externally-facing server
or if you are working on your site which later you will host it on any hosting server then after going live the images will appear.
because google want that the images should be somewhere on the internet not on the local so it can fetch it.
Upvotes: 2