Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Email Image not Showing (Gmail)

I've composed an email in HTML that has an image in it.

The image "src" attribute has a URL pointing to a controller action endpoint on my server (ASP.Net) which returns a FileContentResult.

An example of the img tag looks like this:

<img src="https://www.mywebsite.com/controller/action?argument=value" width="600" height="300" alt="HeadingImage" title="HeadingImage">

The email displays as expected in Outlook.

If I take the source from Outlook and just view it in Chrome desktop, it still works fine.

If I visit the img URL in Chrome the image is downloaded.

However, if I view the email in Gmail the image does not display. Why might this be the case? I get a single error in the console looking something like this:

ci6.googleusercontent.com/proxy/<SNIP>https://www.mywebsite.com/controller/action?argument=value GET https://ci6.googleusercontent.com/proxy/<SNIP> 404 ()
like image 852
Ben Avatar asked Nov 07 '22 21:11

Ben


1 Answers

Hi you can use this it's work for me

Including the scheme in the src url (using "//" does not work - use full scheme EG: "https://") Including width and height attributes Including style="display:block" attribute Including both alt and title attributes

like image 180
Kirti Nariya Avatar answered Nov 14 '22 23:11

Kirti Nariya