In most of my emails, the image included may not be present. In such cases the broken image icon is displayed along with my alt
text.
Problem Explanation:
While sending an HTML email along with an <img>
tag, at cases this image may not be there (404). As the image URL is dynamic, I cannot verify the existence of the image before sending the email. So it displays a broken image icon. I want to get rid of this icon.
Code Snippet:
<img alt="NA" src="http://www.somerandomdomain.com/error.png" width="120" >
I am need of a solution compatible with all major email clients.
- Have tried
onerror
handler, but it does not work in email clients. - Also have tried
text-indent: -9999px;
, it works in Outlook but not in Gmail. - When the negative indent is changed to positive Outlook scrolls to the right which is a mess.
The solutions mentioned in possible duplicate, are for the web. But my question is clearly about the HTML emails, where JS and objects does not work like the solutions provided.