How can I force email programs to show images send in html email using php?
I am sending an html email with php and it includes an image. Some email programs, such as gMail have a 'display images' button. The user has to click on that in order for the images in the email to show up.
Is there any way I can force email programs to show images that are sent within html emails generated by php?
As a rule of thumb, email clients are configured to display attached images by default (e.g. those with a cid: URI scheme) and not load remote images (which can include tracking information).
If you attach all the images, then you'll usually get them showing up (while inflating your SMTP bandwidth use along with that of your recipients (which can make you unpopular)).
I'm afraid not. The main reason email programs block images is because images are often used to 'report back' to whoever sent the email that the email has been opened. This is a common tactic used by spammers. Also, malicious code is often attached to images and downloading these images is how such code gets executed. Another reason email programs block images.
No, you can't force programs you didn't write yourself to do anything.
You specifically mention gmail so it's worth pointing out that if you embed (CID URI) the images they won't show inline, they'll show as attachments at the bottom of the message.
Doubt it, it would be a security issue if the 'src' of an image opened up a cross site scripting attack.
Customers of a bank in Mexico were attacked in early 2008 with an image tag in email and were sent through their home routers to the wrong website.
You can, but unfortunatley Trident, which is the IE rendering engine doesn't support it (surprise, surprise), but it is technically possible to include images in the html itself - see http://en.wikipedia.org/wiki/Data_URI_scheme
The last place I worked, we were sending out emails that had images in them that would come up automatically, in outlook at least, without me having to explicitly click a show images button.
When I inquired, another developer explained that they simply copied the encoded block of the image from an already sent email into the body of the email. I think this may be a weird sort of workaround they stumbled upon. I don't know if this adds more weight than an attachment, but I could see how an email reader would see an attachment and then ask the user as opposed to read it already in the body and just show it...