Tech and Life

    Home     Archive     Projects     Contact

Gmail not showing html image

When gmail is not showing a html image, make sure to check the following things.

1. It is public

Check whether the image can be loaded from another location than your own IP. For example you could check it using your mobile (disable wifi), ask a friend or check it using ssh on a remote server.


curl -I

When the server responds with a 200 http status code, you are good to go.

2. The src attribute does not contain newlines and spaces

Make sure the URL within the src attribute does not contain any newline or space. Even a newline just before the ending quote could stop gmail from loading the image. Oddly, sometimes an image url with newlines does load after clicking the option: [Message clipped] View entire message.

Wrong (newline):

<img src="


<img src="">

3. It has a width and height attribute

Make sure to add the width and height attributes to the image.

<img width="185" height="60" src="">

4. It has an alt and title attribute

Try adding the alt and title attributes.

<img src="" width="185" height="60" title="Google logo" alt="Google logo">

Hope this helps!

If you liked this post, you can share it with your followers!