Gmail shows download icon on images of HTML Email

2020-06-12 04:36发布

问题:

We have a Html Builder, that allows you to create responsive html for emails. We are using a third party engine to send the emails in bulk. The problem is, when email is being opend in gmail inbox, it shows download icon on some of images (not all), while their generated html is same when compared to images without download icons.

Why would gmail add download icons for images on emails. Looks like its treating images like attachment. Any info, fix or suggestion is appreciated ?? Here is the generated html that we are sending-

<table align="center" border="0" cellpadding="0" cellspacing="0" height="100%" width="100%" class="bodyContainer">
    <tr>
        <td align="center" valign="top" >
            <table border="0" cellspacing="0" cellpadding="0" class="emailContainer">
                <tr>
                    <td>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td>
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td style="text-align: center; padding: 0px;">
                                                <img src="http://img.xyz.net/gallery/212aeedd-2672-4960-a81c-8b78635c8fd9/firsthalf.jpg" width="598" border="0" style="max-width: 600px;" hspace="0" vspace="0">
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td>
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td style="text-align: center; padding: 0px;">
                                                <img src="http://img.xyz.net/gallery/212aeedd-2672-4960-a81c-8b78635c8fd9/secondhalf.jpg" width="300" border="0"style="max-width: 300px;" hspace="0" vspace="0">
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td>
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td style="text-align: center; padding: 0px;">
                                                <img src="http://img.xyz.net/gallery/212aeedd-2672-4960-a81c-8b78635c8fd9/2110513155A40L.jpg?asd" width="250" border="0" style="max-width: 250px;" hspace="0" vspace="0">
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td>
                                    <table border="0" cellpadding="0" cellspacing="0" width="100%">
                                        <tr>
                                            <td>
                                                <h1>Ready To Create An Amazing Product??</h1>
                                            </td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td valign="top">
                        <table width="100%" border="0" cellspacing="0" cellpadding="0">
                            <tr>
                                <td>
                                    <table width="100%" border="0" cellspacing="0" cellpadding="0">
                                        <tr>
                                            <td>Now that you've selected your template layout, it's time to get the creative juices flowing and show off your awesome email marketing skills. You can build the perfect email using our powerful and easy-to-use editor. You can drag-and-drop different types of blocks directly into your email and start adding text, images and links. You can also go to the 'Design' tab to customize all the fonts and colors.</td>
                                        </tr>
                                    </table>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
                <tr>
                    <td>
                        <table width="100%" border="0" cellpadding="0" cellspacing="0">
                            <tr>
                                <td valign="top">
                                    <div align="center">
                                        Phone: 555-555-1234 | Email: email@my-website-address.com
                                        Web: www.my-website-address.com
                                    </div>
                                </td>
                            </tr>
                        </table>
                    </td>
                </tr>
            </table>
            <div class="complianceFooter">
            </div>
        </td>
    </tr>
</table>

following link are wondering for somthing similer..

http://www.codeproject.com/Questions/439012/Email-images-are-rendered-as-attachments-in-gmail

https://productforums.google.com/forum/#!topic/gmail/BosiJUnYDt0

Is it some sort of bug or anything ?? If you guys can provide me any link or something, that would be great.. Thank you guys

回答1:

This is a new feature Google implemented a several weeks back, I believe it only works on "large" images, but I could not find out the exact constraints. It seems to happen more so where you have a very large hero image.

As a feature I assume it's more intended where someone you know personally has provided you with a Photo embedded into the email, there is also another feature that allows you to add it straight to your Google Drive.

A Google Plus post from Gmail themselves

A blog post about it



回答2:

I have fixed this by wrapping my large images in an anchor tag like this one:

<a href='#'>

If you don't want the user's cursor to indicate a link, add style='cursor: default;' to your img element.



回答3:

I was able to fix this by cutting my image into 4 equal pieces vertically and then coding the 4 images in with the following code.

<table width="800" border="0" align="center" cellpadding="0" cellspacing="0" summary="Split Image">
<tr>
<td><img src="image1" width="200" height="200" alt="Part 1x1" border="0" /></td>
<td><img src="image2" width="200" height="200" alt="Part 1x2" border="0" /></td>
<td><img src="image3" width="200" height="200" alt="Part 1x3" border="0" /></td>
<td><img src="image4" width="200" height="200" alt="Part 1x4" border="0" /></td>
</tr>
</table>


回答4:

As @Pebbs explained above, Gmail appears to detect images within certain size constraints as downloadable attachments. To circumvent this, what worked for me was using the "background" attribute to display the image within a <td> tag. This effectively makes Gmail perceive the image as a background image, rather than as a potentially downloadable <img>. So for example, within your code instead of the following:

<td>
<img src="your_image.jpg" alt="Your Image" height="114" width="275"  style="border: 0 none;" />
</td>

Use:

<td background="your_image.jpg" valign="top" height="114" width="256" style="background-position: 0 100%; background-repeat: no-repeat;" >
<!--[if gte mso 9]>
<v:rect xmlns:v="urn:schemas-microsoft-com:vml" fill="true" stroke="false" style="width:256px;height:114px;">
<v:fill type="tile" src="your_image.jpg" color="#e6e6e6" />
<v:textbox inset="0,0,0,0">
<![endif]-->
<div>
</div>
<!--[if gte mso 9]>
</v:textbox>
</v:rect>
<![endif]-->
</td>

Note that the VML in between the <td>s might be needed for older email clients to render the image properly.



回答5:

Easy and clean way to prevent image downloading and to remove download icon in gmail

Method 1 :- Add .a5q {display: none !important;} css class into tag.

Method 2 :- Add tabletabletable div {display: none !important;} style into section within tag.

Method 3 :- just Bind your image tag with a(anchor) tag with following css style:
style="cursor:default;"

Method 4 :- An another method to do this , again just Bind your image tag with a(anchor) tag with following css style:
style="pointer-events:none;"



回答6:

In a marketing email you're probably better off anyway having as many images as possible link to your website.

Your massive sale banner should probably just link to your website - no tricks needed.

 <a href='https://bigsale.com'>...</a>

And if you have a large image of an actual product, then it's actually a nice feature allowing it to open in a lightbox inside GMail. The download in that context should appear less out of place.



回答7:

Add this .css class to remove the download icon.

.a5q {display: none !important;}



回答8:

I have fixed this by add this code to syles

table table table div {display: none !important;}