Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

HTML image not showing in Gmail

Tags:

html

gmail

I'm sending an e-mail newsletter in HTML. Inside the HTML I have something like

<img height='70' width='70' style='display:block' src='myDomain.com/imageName.png'>

When I open the newsletter with Thunderbird or Outlook, the image is being displayed. However, when I open it with Gmail, no image is shown. I'm not sure if it's about the proxy that Gmail uses for security reasons or if it's something else. Either way, I'd like to know if anyone ever came across this and if so, how it was solved.

like image 629
Rita Avatar asked Jan 29 '14 17:01

Rita


3 Answers

Late to the party but here goes... I have experienced this problem as well and it was solved with the following:

  • 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

EG:

<img src="https://static.mydomain.com/images/logo.png" alt="Logo" title="Logo" style="display:block" width="200" height="87" />
like image 72
Howard Avatar answered Nov 09 '22 22:11

Howard


Google only allows images which are coming from trusted source .

So I solved this issue by hosting my images in google drive and using its url as source for my images.

Example: with: http://drive.google.com/uc?export=view&id=FILEID'>

to form URL please refer here.

like image 35
Sachin Gade Avatar answered Nov 09 '22 22:11

Sachin Gade


For me, the problem was using svg images. I switched them to png and it worked.

like image 40
Ruben Miquelino Avatar answered Nov 09 '22 22:11

Ruben Miquelino