Ask A Question

Notifications

You’re not receiving notifications from this thread.

s3 images not showing up in gmail?

Jason Ormes asked in Rails
So I'm sending an email using actionmailer which has an image-tag for an image that is stored out in S3.  For some reason gmail doesn't display the image.  it displays images that are coming from the application server.  outlook.com and thunderbird seem to be displaying the S3 images correctly.

Anyone have any thoughts.

Jason
Reply

I have experienced this problem as well and it was solved with the following:

  • Including the scheme in the src url (using "//" does not work - use full scheme EG: "https://")
  • Including width and height attributes
  • Including style="display:block" attribute
  • Including both alt and title attributes

For example:

<img src="https://static.mydomain.com/images/logo.png" alt="Logo" title="Logo" style="display:block" width="200" height="87" />

Reply
Thank you for the reply, thats what it turned out to be.  Seems gmail doesn't like protocol relative urls.
Reply
Join the discussion
Create an account Log in

Want to stay up-to-date with Ruby on Rails?

Join 85,376+ developers who get early access to new tutorials, screencasts, articles, and more.

    We care about the protection of your data. Read our Privacy Policy.