Image links broken in Gmail because of google's Image proxy

PhpEmailGmail

Php Problem Overview


Image links in gmail are broken because of google's Image proxy (news1,news2). I can't load my site's images in gmail.

Actual image path is: http://sampleimageurl.com/images/logo.jpg

But I get the same image path like this in gmail:

https://ci3.googleusercontent.com/proxy/CUiMBo2ELdin8h5R_jKaarbsjQOZUXM3765smBK1PB4BsKq9EsVziwcOYFqjZqCkRDyu1jzoityEA_PJ=s0-d-e1-ft#http://sampleimageurl.com/images/logo.jpg

Does anyone knows how to solve this issue?

Php Solutions


Solution 1 - Php

Because your image wasn't open to public.

You need make sure the new Gmail image proxy can fetch your image from google server.

Solution 2 - Php

In Google Apps, it's now possible to disable Image Proxy for GMail (in Apps Settings). Or, better, you can white-list your internal URLs for which image proxying should be disabled.

Solution 3 - Php

DEG’s research has confirmed reports from wordtothewise blogger, Laura Atkins, that “Google is rewriting image links. This rewriting appears to be happening during the delivery process. Older messages that are currently in mailboxes aren’t showing this tracking.”

For global images, this means only one user has to open the mail and the images are pulled from the server. In the case of tracking images, every image file name is unique. Every new open will cause Google to grab the uniquely named image. The result is that senders can track the first open, but no subsequent opens.”

Reference: http://www.degdigital.com/blog/gmail-tracking-disruption-for-marketers/

Solution 4 - Php

Two things that might help:

  1. Use traditional image formats like .jpg, .png, .gif (formats like svg do not always work)
  2. Make sure there are no spaces or strange characters in the image path (Check your server request logs. If it gives a 404 to google it is probably a link format issue.)

Solution 5 - Php

I am from Asp.Net world, but I had the same issue.

  • Gmail could not cache image while I tested locally
  • image's .svg extension was problematic

So, I resolved this issue only by changing the image extension (to .png) and deploying the app to the server (in that case Gmail could access my image for caching and I saw the image in email).

Solution 6 - Php

Change the image's location. In the new Google setup, the first time an image is opened, Google downloads the image and caches it on a Google managed proxy.

Solution 7 - Php

Had similar issue with and it was because I had .htpasswd turned on for my staging site.

Solution 8 - Php

I had the same issue and I solved the problem hosting the images in my public server (http://mydoamin.com/img/images.jpg).

Next step responsive email displaying responsive images: CSS

@media only screen and (max-device-width: 480px) {
   td.headercell { 
      background-image: url(images/[email protected]) !important;
      background-size: 325px 115px;
      width: 325px !important;
      height: 115px !important;
   }
   td.headercell img {
      display: none;
   }
}

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionBalaji KandasamyView Question on Stackoverflow
Solution 1 - PhpmrduguoView Answer on Stackoverflow
Solution 2 - PhpseredaView Answer on Stackoverflow
Solution 3 - PhpKumar VView Answer on Stackoverflow
Solution 4 - Phpkravits88View Answer on Stackoverflow
Solution 5 - PhpVladimir KraskoView Answer on Stackoverflow
Solution 6 - PhpdimartiView Answer on Stackoverflow
Solution 7 - PhpJoel FernandesView Answer on Stackoverflow
Solution 8 - PhpYassine AhramView Answer on Stackoverflow