HTML image not showing in Gmail

后端 未结 12 1070
难免孤独
难免孤独 2020-11-27 17:42

I\'m sending an e-mail newsletter in HTML. Inside the HTML I have something like

相关标签:
12条回答
  • 2020-11-27 17:45

    I am even later to this party, but after spending about 2 hours trying everything imaginable and not having any luck, I finally realized it will work if I upload the pics to GOOGLE PHOTOS instead of GOOGLE DRIVE. Then I can right-click on the pic, copy the address, paste it in, and it works beautifully.

    0 讨论(0)
  • 2020-11-27 17:49

    In addition to what was said by Howard

    You have to keep in mind that Google encodes spaces as + To avoid this, the ulr must be encoded in RFC 3986, which means spaces encoded at %20, for example:

    https://example.com/My Folder/image 1.jpg to https://example.com/My%20Folder/image%201.jpg

    0 讨论(0)
  • 2020-11-27 17:52

    For me, the problem was using svg images. I switched them to png and it worked.

    0 讨论(0)
  • 2020-11-27 17:52

    Try to add title and alt properties to your image.... Gmail and some others blocks images without some attributes.. and it is also a logic to include your email to be read as spam.

    0 讨论(0)
  • 2020-11-27 17:52

    HTTP or HTTPS should be full address

    background-image: url(http://fulladdress.com/ca/1/product_assets/T/C/X/M/K/NMTCXMK_mu.jpg)

    var mailOptions = {
      from: 'fulladdress@gmail.com',
      to: emails,
      subject: 'i super another ma node mailer cool test',
      text: 'That was easy!',
      html: '<a href="//google.com"><div style="background-image: url(http://fulladdress.com/ca/1/product_assets/T/C/X/M/K/NMTCXMK_mu.jpg);width:500px;height:500px">ascfas</div></a>'
    };
    
    0 讨论(0)
  • 2020-11-27 17:53

    My issue was similar. This is what my experience has been on testing the IMG tag on gmail (assuming most of the organization's would have a dev qa and prod server.)

    I had to send emails to customers on their personal email id's and we could see that gmail would add something of its own like following to src attribute of img tag. Now when we were sending these images from our dev environment they would never render on gmail and we were always curious why?

    https://ci7.googleusercontent.com/proxy/AEF54znasdUhUYhuHuHuhHkHfT7u2w5zsOnWJ7k1MwrKe8pP69hY9W9eo8_n6-tW0KdSIaG4qaBEbcXue74nbVBysdfqweAsNNmmmJyTB-JQzcgn1j=s0-d-e2-ft#https://www.prodserver.com/Folder1/Images/OurImage.PNG
    

    so an image sent to my gmail id as following never worked for me

    <img src="https://ci7.googleuser....Blah.Blah..https://devserver.com/Folder1/Images/OurImage.PNG">
    

    and our dev server we can't render this image by hitting following URL on Chrome(or any browser).

    https://www.devserver.com/folder1/folder2/myactualimage.jpg
    

    now as long as the src has www on it worked all the time and we didnt had to add any other attributes.

    <img src="https://www.**prodserver**.com/folder1/folder2/myactualimage.jpg">
    
    0 讨论(0)
提交回复
热议问题