I'm sending an email using the SMTP protocol in Django. When I send the image link it is like this:
https://example.com/images/pic1.jpg
But Gmail converts it to something like this:
https://ci5.googleusercontent.com/proxy/vI79kajdUGm6Wk-fjyicDLjZbCB1w9NfkoZ-zQFOB2OpJ1ILmSvfvHmE56r72us5mIuIXCFiO3V8rgkZOjfhghTH0R07BbcQy5g=s0-d-e1-ft#https://example.com/images/pic1.jpg
I tried the image URL proxy whitelist setting. It is showing the preview of the image.But image links are not working.
PS: I have also tried methods suggested here to no avail.
Update 1: The images are stored in the AWS s3 bucket. If I make them public then they work fine. But I can't make them public.Is there any other way?
The images are stored in the AWS s3 bucket. If I make them public then they work fine. But I can't make them public.Is there any other way?
The short answer is "no" if you want to keep referencing image through URLs as GMail's image proxy needs access to your images over the "public" internet one way or another.
This question is a bit off topic as it has little to do with Django but if you're using GMail for business you can configure which URLs should not go through the proxy. This should allow you to prevent images served from your "private" S3 bucket URL from being proxied. Note that this will only work for GMail accounts within your business domain; the images will be proxied and fail to load if the email is sent to a non-business or a different business Gmail account for example.
One another way you could avoid proxying completely it to attach the image in the email instead of referring to it through an URL. You can refer to this answer for how to achieve that https://stackoverflow.com/a/3787766/70191.