I built an app where users can upload pictures and the system automatically sends notification emails to registered Gmail accounts. The problem is that image thumbnails in these emails are not showing up properly.
When I check the email source code, I notice that Gmail has changed the original image src attribute to something like: https://ci3.googleusercontent.com/proxy/ABC123xyz...s0-d-e1-ft#https://mywebsite.com/uploads/2023/image_sample_640x480.jpg
It looks like Gmail is routing the images through their proxy service. The weird part is that if I visit the original URL directly (https://mywebsite.com/uploads/2023/image_sample_640x480.jpg), the image loads perfectly fine.
I already tried clearing my browser cache but the issue continues. Is there a way to prevent Gmail from using this proxy system or make the thumbnails work with it? The images are hosted on a public server so they should be accessible to anyone.
totally get it, man. give your server settings a look, since some might block those proxy requests. also, check your firewall—could be a reason for the loading issue with the imgs.
Had this exact problem six months ago with my client notification system. Turned out to be CORS headers on my server. Gmail’s proxy needs proper Cross-Origin Resource Sharing config to fetch your images. Check if your server’s sending the right Access-Control-Allow-Origin headers when Gmail’s proxy hits your images. Test it by checking your server access logs - see what response codes you’re getting from Google’s proxy servers. Also helped to serve images over HTTPS with valid SSL certs. Gmail’s proxy is way stricter about security than regular browsers. If you’re using a CDN or image host, make sure they allow requests from Google’s image proxy too.
This is a common Gmail issue. Gmail routes images through their proxy servers to protect users from malicious content - that’s why you’re seeing those proxy URLs. Your server probably isn’t handling requests with different User-Agent headers or referrer info properly. I had the exact same problem last year with my notification system. I fixed it by checking my server logs to see what status code Gmail’s proxy got when trying to fetch images. Turns out my hosting provider was blocking requests without standard browser headers. Contact your hosting support to whitelist Google’s image proxy or tweak your server config to accept these requests. Also make sure your images have proper MIME types and don’t need authentication headers.