Ben
Ben

Reputation: 51

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 ()

Upvotes: 5

Views: 8480

Answers (3)

Laxman Gite
Laxman Gite

Reputation: 2328

First You need to add that image on your deployed project folder and then you need to specify the path of your Image :

<img src="http://www.mywebsite.com/Images/YourImage.png" />

Cheers !!

Upvotes: 0

Kirti Nariya
Kirti Nariya

Reputation: 247

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

Upvotes: 1

Super User
Super User

Reputation: 9642

Just add http:// in image src

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

Upvotes: 0

Related Questions