I use wordpress cms. I have built a simple email system wherein people can select posts. The code pulls the featured image of each selected post. On submit the images are sent to my gmail account with some html text content.

Problem is it is just displaying the links to those images, instead of the images itself. In my gmail account, I have this set Settings=>General=>Images=>Always display external images. Here is a visual reference.

enter image description here

OBSERVATION - I can say that my code is alright as the images display fine in my outlook.com's email account and also because it had been displaying in the gmail account itself until very recently. Other observation is when I access the same gmail account in my smartphone, the image div seems to be empty with only the border and a tiny icon in the middle.

Do not want you to miss out anything so in case it is relevant - The one thing that I tried a few days ago was setup an SMTP email setup with smtp.gmail.com using the login credentials of the same gmail account. At first I got a suspicious login attempt warning but the email setup worked fine after I added it as an exception.

I wonder what is happening, any ideas on what to try.


FIRST UPDATE : I have tried sending to an alternative gmail account but the outcome is the same, displays only the links instead of images. If you must also know I have my site hosted on hostgator.com and the email sent is via gator3897.hostgator.com.

SECOND UPDATE : As asked in the question here is an example of what my image's html looks like when clicked in the show-original in gmail. As I said this renders beautifully as intended in my outlook account so the mistake shouldnot be in the code.

<a href="http://examplewebsite.com/link-to-some-post/">
<img src="http://examplewebsite.com/media/2014/04/example.jpg" class="attachment-class" alt="some alt text" 
height="300" width="230">

THIRD UPDATE : I checked to see how it appears in chrome. Turns out it still does not display the image as intended but it does not turn into links, instead it appears as empty divs. It appears the same way in my smartphone. Screenshot below. enter image description here

  • Just got an idea of something i can try. I will set some other recipient email which is just alternative gmail account and see how it goes.
    – gurung
    May 21, 2014 at 8:42
  • Nope, does not work.
    – gurung
    May 21, 2014 at 9:24
  • "the image div" - How exactly are you showing the image in your content? An img or a div?
    – MrWhite
    May 21, 2014 at 11:03
  • @w3d Please check my second update at the bottom of the question.
    – gurung
    May 21, 2014 at 11:12

1 Answer 1


Mail servers like Gmail, yahoo, hotmail and others always block images from displaying as a security measure.

If the images in your email templates are embedded correctly, you should not worry about anything as this is something from the receiver's mailbox.

This is not considered as an issue, the receiver get an option in the email header "Display images" and once they click on it, they will see the images. This is something that you do not have any control over.

If you like to control both behaviors i.e. the display or non-display of images in Gmail, dive into Gmail Settings.

  1. Click the gear icon in the upper right, and then select Settings.

  2. Scroll to the External content section. Select Ask before displaying external content. Alternatively, you can select Always display external content.


enter image description here

3.Click Save Changes.


Check one more thing :

In case the images in your email are not appearing in GMail, then you might need to disable the HTTPS settings

To disable the HTTPS for your gmail account

Log in to your Gmail account.
Click "Settings" in the right corner.
Scroll to the Browser Connection, under the General tab and check "Don't always use https".
Click "Save Changes"
Log out of Gmail.
  • Thanks for the effort but there is no option to disable the HTTPS in my gmail account, as suggested in your second method. No such thing option called Browser connection under the General tab or anywhere else. Are you sure about this, have you check it yourself.
    – gurung
    May 21, 2014 at 10:45
  • Please check the quesiton again as I have added a screenshot of what my external images setting under General looks like. I am surprised how it differs from you. You must be using a paid gmail application.
    – gurung
    May 21, 2014 at 10:53
  • Sorry gurung look like something is diffrent,will check and get back to u ASAP, mean while u can check below link: productforums.google.com/forum/?hl=en#!category-topic/gmail/… May 21, 2014 at 11:09
  • There would appear to be regional differences in how gmail looks exactly and the options available. I seem to get the same view/options as the OP (I'm in the UK). I no longer have options to control HTTPS (although I used to), I am always on HTTPS. (Although turning off HTTPS would be a last resort I would have thought.)
    – MrWhite
    May 21, 2014 at 11:20
  • 1
    "always block images from displaying as a security measure." - actually, Gmail no longer block images by default for "security". This was announced in a blog post in Dec 2013 - you need to explicitly turn this off in settings. This is because all image requests now go via Google's servers which scan for malware. However, the source site is still able to detect when images are requested (and emails are read).
    – MrWhite
    May 21, 2014 at 11:29

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.