I have an email sent out in in my application, and in the HTML of that email, i have an <img>
tag which is an image and a link.
The problem is that 开发者_如何转开发in most cases the image doesn't load in emails, unless you enable the viewing of embedded images.
That image is an important part of the email. Is there any way I can replace the image tag with something else which always loads in emails? The desire is that users don't have to explicitly click on show pictures to see it.
Absolutely... you can embed the image as an attachment, and then use the CID header in the mail MIME to reference it (instead of a URL to a web resource)
There is no way to guarantee that an image will be displayed without explicit permission of the user. That would circumvent the whole concept if it were possible. The idea is to protect the user from exposure to undesirable content. In the event you were to find some hack way around it, it would be considered just that, and could get you blacklisted once the hack is discovered.
Is the img
tag just a reference to an external image that's hosted somewhere? You could try adding it to the email as an embedded resource and see if that helps. Some mail clients may still ask permission before displaying it, though. But it should get more of the target audience.
精彩评论