0

I trying to send an email to a User, but for some reason, my images are not rendering and I getting: enter image description here. When I try to Inspect Element in Gmail, my images src are not correct:

https://ci5.googleusercontent.com/proxy/BAKUQWuXu4XR7w4v6hboZ0E9LQlwspSfcV4K1tkK6rgoPeQrt0b0J-Q2ndKdbTAV5-XJa4yrVHuTKpBy24_Q-QWt7PnLFY0VanfclSmZrTgg=s0-d-e1-ft#http://test.com/images/email_upload/my-image.png 

Correct Url:

http://test.com/images/email_upload/my-image.png 

This is my template:

<a href="#" style="color: #4cb2e1; font-weight: lighter; text-decoration: none">
    <img src="{{ asset('images/email_upload/my-image.png') }}" width="150" height="50" style="margin-left: 20px; margin-right: 12px" align="left">
</a>

P.S. I using Laravel mailable.

Synchro
  • 35,538
  • 15
  • 81
  • 104

2 Answers2

2

This is a Gmail "feature"; They precache images referenced from email messages and rewrite URLs to point at their own copies, purportedly as a way of reducing load and blocking tracking pixels. To be sure you're actually sending the correct content, BCC yourself at a non-gmail address and then compare the resulting received messages to see exactly what gmail is changing.

One fundamental issue is that you don't seem to be serving images over HTTPS; that's mostly considered a bug these days.

A side-effect of this is that received messages cannot be reverified for DKIM, which at least partly undermines the point of DKIM.

There is further discussion of this problem in this excellent answer, and others answers to that question. Unfortunately the consensus seems to be that Google's image caching system is buggy, but that's nothing new as far as gmail is concerned.

Synchro
  • 35,538
  • 15
  • 81
  • 104
  • 1
    Does it have nothing to do with trustworthy content? By the way thanks for reply! – Domantas Šlaičiūnas May 08 '20 at 09:36
  • 1
    I don't think so – but there are some things check in those other answers: ensure you're serving correct MIME types, make sure the images don't 404, use HTTPS, check your server logs to see what happens to requests for the google image cache service, etc. – Synchro May 08 '20 at 09:38
0

try this embeded method embed(public_path('/images/logo.svg')) }}">